Monday, October 21, 2013

ADDITION, SUBTARCTION,MULTIPLICATION, DIVISION OF TWO NO.

*WAP TO ENTER TWO NO.S AND PERFOERM ADDITION, SUBTARCTION,MULTIPLICATION, DIVISION.


#include<stdio.h>
#include<conio.h>

 void main()
 {
      float a;
      float b;      // donot input b=0, in the case of                                   division.
      float r;

      clrscr();
      printf("\nEnter 1st no.=");
      scanf("%f",&a);
      printf("\nEnter 2nd no.=");
      scanf("%f",&b);
      r=a+b;                // Here r stands for addition.
      printf("\nAddition of two no.s=%f",r);
      r=a-b;               // Here r stands for subtraction.
      printf("\nSubtraction of two no.s=%f",r);
      r=a*b;              // Here r stands for multiplication.
      printf("\nMultiplication of two no.s=%f",r);
      r=a/b;             // Here r stands for division.
      printf("\nDivision of two no.s=%f",r);
      getch();

 }