C Program : Write a C Program to explain about Arithmetic Operators?

Write a C Program to explain about Arithmetic Operators?



/* This program explains about the arithmetic operators */
 
  #include <studio.h>
   main()
     {

       int a, b, c;
       printf(" Enter two integer values : ");
       scanf(" %d%d", &a, &b);
       printf(" Addition : %d + %d is %d \n", a, b, a + b);
       printf(" Substraction : %d - %d is %d \n", a, b, a - b);
       printf(" Multiplication : %d * %d is %d \n", a, b, a * b);
       printf(" Division : %d / %d is %d \n", a, b, a / b);
       printf(" Modulo Division : %d % %d is %d \n", a, b, a % b);
     
     }



Input : Enter two integer values : 4, 2
Ouptut :
  Addition : 4 + 2 is 6
  Substraction : 4 - 2 is 2
  Multiplication : 4 * 2 is 8
  Division : 4 / 2 is 2
  Modulo Division : 4 % 2 is 0

Post a Comment

0 Comments