Saturday, 26 September 2015

Program to find sum, substract, multiplication and division of two numbers

/*Program to find sum, substract, multiplication and division of two numbers*/
#include<conio.h>
#include<stdio.h>
void main()
{
     float a,b,sum,sub,mul,div;
     clrscr();
     printf("Enter any two numbers");
     scanf("%f%f",&a,&b);
     sum=a+b;
    sub=a-b;
     mul=a*b;
     div=a/b;                   Printf("sum=%f\nsub=%f\nmul=%f\ndiv=%f",sum,        sub,mul,div);
      getch();
}
Output: Enter  any two numbers:14
                6
              Sum=20
              Sub=8
              Mul=84

              Div=2.333

No comments:

Post a Comment