Here you will get C++ program to add two numbers.
The program will ask user to enter two numbers and then calculate their sum.
using namespace std;
cout<<"Enter first no: ";
cout<<"Enter second no: ";
cout<<"\nSum = "<<sum;
Enter first no: 4
Enter second no: 6
Sum = 10
6 thoughts on “C++ Program to Add Two Numbers”
Thanks.. We can also add two numbers using pointers in C.
I m not understand
it is not working
its very helpful to me
i am a student studing in +2 computer science
i am also interested in programing
i am also from india
Can anyone explain the use of “using namespace std”, please?
using namespace std says if you find something that is not declared in the current scope go and check std. using namespace std; are used. It is because the computer needs to know the code for the cout, cin functionalities and it needs to know which namespace they are defined.