C program to perform a arithmetic operation in a single program like addition,subtraction,multiply and division.
#include<stdio.h>
#include<conio.h>
void main()
{
int first,second;
int sum,sub,mul;
float division;
printf("enter the two numbers\n");
scanf("%d%d",&first,&second);
sum=first+second;
sub=first-second;
mul=first*second;
divison=first/second;
printf("Addition=%d\n",sum);
printf("Subtraction=%d\n",sub);
printf("Multiplication=%d\n",mul);
printf("Division=%f\n",division);
getch();
}
Output:-
No comments:
Post a Comment