Tuesday, December 28, 2010

C++ Functions

#include



int addNum(int x,int y) {
return x+y;
}


int main() {


int numOne;
int numTwo;
std::cout << "Enter Two numbers Please:"; std::cin >> numOne >> numTwo;

int sum = addNum(numOne,numTwo);
std::cout << "The sum of " << numOne << "And " << numTwo <<"is"<< sum << std::endl;

return 0;

}

No comments:

Post a Comment