Monday, 7 April 2014

Write a program to find: i. Addition of two numbers. ii. Subtraction of two numbers. iii. Multiplication of two numbers. iv. Division of two numbers.

#include<stdio.h>
main()
{
     int a,b,add,sub,mul,div;
     printf("\nEnter two numbers=");
     scanf("%d%d",&a,&b);
     add=a+b;
     printf("\nThe addition of %d and %d is %d",a,b,add);
     sub=a-b;
     printf("\nThe difference of %d and %d is %d",a,b,sub);
     mul=a*b;
     printf("\nThe product of %d and %d is %d",a,b,mul);
     div=a/b;
     printf("\nThe division of %d and %d is %d",a,b,div);
}

No comments:

Post a Comment