Header Ads Widget

Responsive Advertisement

C++ CALCULATION PROGRAM - 2

Write a C++ program to perform arithmetic calculation between two numbers while assigning the values on runtime.

 #include<iostream.h> //Start of the program.
 #include<conio.h>

 int main()        
 {
     cout<<"\n\t\tSIMPLE CALCULATION PROGRAM\n\n\n"; //Displaying the content.

     int a,b;  //Declaring the variables.
     cout<<"\n\tEnter the First Number :\t"; //Displaying First message  
     cin>>a;             //Assigning first value to a.
     cout<<"\n\tEnter the Second Number :\t"; //Displaying Second message
     cin>>b;            //Assigning the second value to b.
     cout<<"\n\n\n\tSUM of two numbers are :\t"<<a+b; //Addition result output.
     cout<<"\n\n\n\tDIFFERENCE of two numbers are :\t"<<b-a;  //Addition result output.
     cout<<"\n\n\n\tPRODUCT of two numbers are :\t"<a*b //Subtraction result output.
     cout<<"\n\n\n\tDIVISION of two numbers are :\t"<<b/a;  //Division result output.
     cout<<"\n\n\n\tMODULUS of two numbers are :\t"<<a%b;  //Modulus result output.
     getch();
}                      //End of the program.

\n- Places the cursor on the line.

OUTPUT:




 Write a C++program to perform arithmetic  calculation between two numbers.





Post a Comment

0 Comments