Starting Vocational Training From 1-May-2024 Get Detail


Write a program in C++ to print the sum of two numbers. 

Sample Output:
Print the sum of two numbers :
-----------------------------------
The sum of 29 and 30 is : 59


#include <iostream.h>
int main()
{

  int a,b;

   cout<<"Enter two values";

  cin>>a>>b;

    cout << " Print the sum of two numbers : ";
    cout << "----------------------------------- ";
    cout << " The sum of a and b is : "<< a+b <<" " ;
}