Skip to main content

//Arthmatic Operator

//Arthmatic Operator



  1. #include <iostream>
  2. using namespace std;
  3. int main() //'int' datatype  use when which kind of value return in code.
  4. {
  5. int a = 21; //int use for integer value.
  6. int b = 10;
  7. int c;

  8. //Addition
  9. c = a + b;
  10. cout<<"line 1 - value of c is :" <<c<< endl;  //"cout" use for print line. 

  11. //Subtraction
  12. c = a - b;
  13. cout<<"line 2 - value of c is :" <<c<< endl; //"endl" use for linebreak. 

  14. //Multiplication
  15. c = a * b;
  16. cout<<"line 3 - value of c is :" <<c<< endl;

  17. //Division
  18. c = a / b;
  19. cout<<"line 4 - value of c is :" <<c<< endl;

  20. //Modulus
  21. c = a % b;
  22. cout<<"line 5  - value of c is :" <<c<< endl;

  23. return 0;
  24. }


//Output

/* 

  the value of c is :31

the value of c is :11

the value of c is :210

the value of c is :2.1

the value of c is :1    

*/


//Here You Can Execute The Program

//Execute"



//ThE ProFessoR