CodeGrabber
{ USER }
posts: 23
last: 28-Apr-2008
TITLE: Function example
DESCRIPTION: Create your first function in C++
Submitted: 09-Apr-2008 08:06:42 ( 21w 5d 2h ago ) Language: C++ (*.cpp *.h)
Views: 218 Lines of Code: 29 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Beginner
Bookmark
/* Author: 
   Date: 09-04-2008
   Filename: 
   Description: 
   History: 
*/



#include <iostream.h> 
int AddIt(int x,int y)
{
return (x + y);
}

int main()
{
int a,b,c;
cout<<"Please enter two integers to add :\n";
//get the two integers
cin>>a;
cin>>b;
//call the AddIt function
c = AddIt(a , b);
//display the answer
cout<<"The answer is : "<<c<<endl;

return 0;
}