#include<stdio.h>
#include<stdlib.h>
void add();
void sub();
void multi();
void divi();
void modu();
int a,b;
void main()
{
int ch;
while(1)
{
printf("\n\n Enter the first no: ");
scanf("%d",&a);
printf(" Enter the second no: ");
scanf("%d",&b);
printf("\n1.addition\n2.substraction\n3.multiplication\n4.division\n5.modulus\n6.exit");
printf("\n\n Enter the choice :");
scanf("%d",&ch);
switch(ch)
{
case 1:
add();
break;
case 2:
sub();
break;
case 3:
multi();
break;
case 4:
divi();
break;
case 5:
modu();
break;
case 6:
exit(0);
break;
default:
printf("\n Invalid choice");
}printf("\n!..............End of the previous operation..............!");
printf("\n!.............Now move to the next operation............!");
}
}
void add()
{
printf(" addition of %d and %d : %d",a,b,a+b);
}
void sub()
{
printf(" substraction of %d and %d : %d",a,b,a-b);
}
void multi()
{
printf(" multiplication of %d and %d : %d",a,b,a*b);
}
void divi()
{
printf(" division of %d and %d : %d",a,b,a/b);
}
void modu()
{
printf(" modulus of %d nad %d : %d",a,b,a%b);
}
OUTPUT :

Great 👍👍
ReplyDeletethanks bro..❣💓
Delete