Header Ads Widget

Responsive Advertisement

C++ CALCULATION PROGRAM - 1

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

 #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=10, b= 20; //Declaring the variables and assigning the values to the variables
     cout<<"\n\n\n\tSUM of two numbers are :\t"<<a+b;  //Addition result .
     cout<<"\n\n\n\tDIFFERENCE of two numbers are :\t"<<b-a;   //Subtraction  result.
     cout<<"\n\n\n\tPRODUCT of two numbers are :\t"<a*b //Multiplication result.
     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 while assigning the values on runtime.















Post a Comment

0 Comments