C++ Program

Object:-Program To Use All Arithmetic Operators.

#include<iostream.h>
#include<conio.h>
void main()
{
  int a,b,c,d,e,f,g;
  clrscr();
  cout<<"
  Enter First Number a : ";
  cin>>a;
  cout<<"
  Enter Second Number b : ";
  cin>>b;
  c=a+b;
  d=a-b;
  e=a*b;
  f=a/b;
  g=a%b;
  cout<<" Addition = "<<c<<"";
  cout<<" Subtraction = "<<d<<"";
  cout<<" Multiplication = "<<e<<"";
  cout<<" Division = "<<f<<"";
  cout<<" Modulus = "<<g<<"";
  getch();
}

Output

Enter First Number a : 20
Enter Second Number b : 10
Addition = 30
Subtraction = 10 
Multiplication = 200 
Division = 2
Modulus = 0

Explanation


									
									
									







You may also like: