Home Uncategorized Demo on Arithmetic Operations

Demo on Arithmetic Operations

SHARE

Write a C Program to Demonstrate Arithematic operations.

#include<stdio.h>
int main()
{
   int a,b,c;
   printf(“Enter two values : \n”);
   scanf(“%d %d”,&a,&b);
   c=a+b;
   printf(“Addtion of two numbers is : %d\n”,c);
   c=a-b;
   printf(“substraction of two numbers is : %d\n”,c);
   c=a*b;
   printf(“multiplication of two numbers is : %d\n”,c);
   c=a/b;
   printf(“Division of two numbers is : %d\n”,c);
   c=a%b;
   printf(“Module division of two numbers is : %d\n”,c);
   return 0;
}

Output :
Enter two values :
12 4
Addtion of two numbers is : 16
substraction of two numbers is : 8
multiplication of two numbers is : 48
Division of two numbers is : 3
Module division of two numbers is : 0

Back to the programs list.