Friday, 14 October 2016

write a C Program to Perform Adding, Subtraction, Multiplication and Division of two numbers From Command line.

Experiment no:1
Aim:-write a C Program to Perform Adding, Subtraction, Multiplication and Division of two numbers From Command line.

Program:-

#include<stdio.h>

main()
{
 int a,b,c,d,e,f;
 printf("Enter a,b values");
 scanf("%d%d",&a,&b);
 c=a+b;
 d=a-b;
 e=a*b;
 f=a/b;
 printf("\n Add=%d",c);
 printf("\n Sub=%d",d);
 printf("\n Mul=%d",e);
 printf("\n Div=%d",f);

}

No comments:

Post a Comment