gokussjx

Add 2 numbers (Class/Object C++)

Jun 24th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. //============================================================================
  2. // Name        : lol.cpp
  3. // Author      : Bidyut
  4. // Version     :
  5. // Copyright   : No rights reserved
  6. // Description : Hello World in C++, Ansi-style
  7. //============================================================================
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. void helloWorld();
  14.  
  15. int main()
  16.  
  17. {
  18.     int a;
  19.     int b;
  20.     int sum;
  21.  
  22.     cout << "Enter first number \n";
  23.     cin >> a;
  24.  
  25.     cout << "Enter second number \n";
  26.     cin >> b;
  27.  
  28.     sum = a + b;
  29.  
  30.     cout << "The sum of the given numbers is (" << sum << ")" << endl;
  31.  
  32.  
  33.     if (sum > 10) {
  34.             cout << "Bidyut Is Awesome!!! \n\n";
  35.         }
  36.  
  37.     helloWorld();
  38.  
  39.     return 0;
  40. }
  41.  
  42. void helloWorld(){
  43.     cout << "Test of new function :-)";
  44. }
Advertisement
Add Comment
Please, Sign In to add comment