In this program, you will learn the working of arithmetic operators. An arithmetic operator performs mathematical operations such as addition, subtraction, multiplication, division etc on numerical values (constants and variables).
#include <stdio.h>
#include<conio.h>
int main()
{
int a = 45, b = 6, c;
clrscr();
c = a + b;
printf("a+b = %d \n", c);
c = a-b;
printf("a - b = %d \n", c);
c = a * b;
printf("a * b = %d \n", c);
c=a / b;
printf("a/b = %d \n", c);
c=a % b;
printf("a mod b = %d \n", c);
getch();
}
a+b = 51
a-b = 39
a*b = 270
a/b = 7
a mod b = 3