C++ Program To Add Two Numbers (Integers)

Take two integers from user and add print their sum.

  1. //Add two numbers
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. int a, b, sum;
  7. cout << "Enter first number: ";
  8. cin >> a;
  9. cout << "Enter second number: ";
  10. cin >> b;
  11. sum= a+b;
  12. cout << "Sum = "<<sum;
  13. return 0;
  14. }

Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]

Join Our Facebook Group

Share this example

Download Android App

download android app

Popular C++ Examples


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube