Advertisement
Guest User

simple function

a guest
Feb 1st, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. int calculation();
  2. int main()
  3. {
  4. cout>>"I have two numbers, I want to add them together";
  5. int firstNumber = 5;
  6. int secondNumber = 7;
  7. int plus;
  8.  
  9. plus = calculation(firstNumber,secondNumber);
  10. cout<<"the two numbers added together are"<<endl;
  11. cout<<plus;
  12.  
  13. }
  14.  
  15. int calculation(int a, int b)
  16. {
  17. int response;
  18. response = a+b;
  19. return response;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement