.. www.engineerscur.blogspot.com: C language program to do all math function on two numbers

C language program to do all math function on two numbers

             This c language program prints multiplication,maximum,addition,subtraction,division and square of given numbers.


#include<stdio.h>
#include<conio.h>
void main()
{
            float mul,add,sub,div,mm,sqra,sqrb,rt,a,b;
            clrscr();
            printf("enter value of number a:");
            scanf("%f",&a);
            printf("enter value of number b:");
            scanf("%f",&b);
            mul=a*b;
            add=a+b;
            sub=a-b;
            div=a/b;
            printf("multiplication is:%f\t\t addition is:%f\n sub is:%f\t\t division is:%f ",mul,add,sub,div);
            if (a>b)
                        {
                                    printf("\na is maximum.");
                        }
            else
                        {
                                    printf("\nb is maximum");
                        }
            sqra=a*a;
            sqrb=b*b;
            printf("\nsquare of a=%f     and    square of b=%f",sqra,sqrb);

            getch();

}