Pages

Wednesday, 21 February 2018

A simple function example in C++ Programming Language

A simple function example in C++ Programming Language

#include <iostream>
using namespace std;
/* This function adds two integer values
 * and returns the result
 */int
sum(int num1, int num2){
   int num3 = num1+num2; return num3;
}

int main(){
   //Calling the function
   cout<<sum(1,99);
   return 0;

}