Addition subtraction multiplication division of two numbers C Program

Here is simple C program to perform addition, subtraction, multiplication and division of two numbers.
#include<stdio.h>
int main()
{
 int a,b;
 int sum,subtraction,multi;
 float division;
 printf("Enter first number: ");
 scanf("%d",&a);
 printf("Enter second number: ");
 scanf("%d",&b);
 sum=a+b;
 printf("Addition of two numbers: ");
 printf("%d\n",sum);
 subtraction=a-b;
 printf("Subtraction of two number: ");
 printf("%d\n",subtraction);
 multi=a*b;
 printf("Multiplication of two numbers: ");
 printf("%d\n",multi);
 division=(float)a/b; /*type casting*/
 printf("Division of two numbers: ");
 printf("%f\n",division);
 return 0;
}







Popular posts from this blog