Search
 
SCRIPT & CODE EXAMPLE
 

CPP

function prototype javascript

function Person(name) {
  this.name = name;
}
Person.prototype.getName = function() {
  return this.name;
}

var person = new Person("John Doe");
person.getName() //"John Doe"
Comment

function and function prototype.

#include<iostream>
using namespace std;

// Function prototype
// type function-name (arguments);
// int sum(int a, int b); //--> Acceptable
// int sum(int a, b); //--> Not Acceptable 
int sum(int, int); //--> Acceptable 
// void g(void); //--> Acceptable 
void g(); //--> Acceptable 

int main(){
    int num1, num2;
    cout<<"Enter first number"<<endl;
    cin>>num1;
    cout<<"Enter second number"<<endl;
    cin>>num2;
    // num1 and num2 are actual parameters
    cout<<"The sum is "<<sum(num1, num2);
    g();
    return 0;
}

int sum(int a, int b){
    // Formal Parameters a and b will be taking values from actual parameters num1 and num2.
    int c = a+b;
    return c;
}

void g(){
    cout<<"
Hello, Good Morning";
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: PascalName seperate strings 
Cpp :: pallindrome string 
Cpp :: how to find common divisors of two numbers in cpp 
Cpp :: c++ Testing implementation details for automated assessment of sorting algorithms 
Cpp :: c ++ Prefix Sum of Matrix (Or 2D Array) 
Cpp :: permutation in c++ with backtracking 
Cpp :: linq select where string equals "String" 
Cpp :: youtube to facebook link converter 
Cpp :: c++ terinary operator 
Cpp :: and condtion c++ 
Cpp :: Check whether K-th bit is set or not c++ 
Cpp :: cpp stacks 
Cpp :: c++ click event 
Cpp :: Write a CPP program to calculate sum of first N natural numbers 
Cpp :: get shape of eigen matrix 
Cpp :: max of 3 numbers in c++ 
Cpp :: traverse string in cpp 
Cpp :: static_cast 
Cpp :: GCD(x, yz) 
Cpp :: add two constant char pointers c++ 
Cpp :: easy way to learn file handling in c++ array 
Cpp :: pcl c++ read .pcd 
Cpp :: all usefull stls in cpp imports 
Cpp :: 378. Kth Smallest Element in a Sorted Matrix using binary search 
Cpp :: lnk2001 unresolved external symbol __imp_PlaySoundA 
Cpp :: ue4 foreach loop c++ 
Cpp :: floating point exception 
Cpp :: show mouse c++ 
Cpp :: font family slick 
Cpp :: Consider a pair of integers, (a,b). The following operations can be performed on (a,b) in any order, zero or more times: - (a,b) - ( a+b, b ) - (a,b) - ( a, a+b ) 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =