Monday, 8 June 2015

3.Aim -WAP To Perform Various Arithmetic operations
Code-
#include<stdio.h>
#include<conio.h>
void main()
{
 int a, b, sum, diff, pro, div;
 clrscr ();
 printf ("Enter The Two Numbers : ");
 scanf ("%d%d", &a, &b);
 sum=a+b;
 diff=a-b;
 pro=a*b;
 div=a/b;
 printf ("Sum=%d\n", sum);
 printf ("Difference=%d\n", diff);
 printf ("Product=%d\n", pro);
 printf ("Quotient=%d\n", div);
 getch ();
}

OUTPUT
Enter The Two Numbers : 19 21
Sum = 40
Difference = -2
Product = 399
Quotient = 0




No comments:

Post a Comment