source file name: basicop.c
void main()
{
int a, b,add,sub,mul,div;
clrscr();
printf("enter 2 numbers");
scanf("%d%d",&a,&b);
add=a+b;
sub=a-b;
mul=a*b;
div=a/b;
printf("\n Addition=%d Substraction=%d",add,sub);
printf("\n Multipication=%d Division=%d",mul,div);
getch();
}
output:
1.
enter 2 numbers 100 5
Addition=105 Substraction= 95
Multipication=500 Division=20
2.
enter 2 numbers 1500 20
Addition=1520 Substraction= 1480
Multipication=30000 Division=75
0 Comments
Post a Comment