#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,n,s,m,su,d;
clrscr();
printf(“enter two no’s : ”);
scanf(“%d%d”,&a,&b);
printf(“enter 1 for sum\n2 for multiply\n3for subtraction\n4 for division: ”);
scanf(“%d”,&n);
switch(n)
{
case 1:
s=a+b; printf(“sum=%d”,s);
break;
case 2:
m=a*b; printf(“multiply=%d”,m);
break;
case 3:
su=a-b; printf(“subtraction=%d”,su);
break;
case 4:
d=a/b; printf(“divission=%d”,d);
break;
default:
printf(“wrong input”);
break;
}
getch();
}
#include<conio.h>
void main()
{
int a,b,n,s,m,su,d;
clrscr();
printf(“enter two no’s : ”);
scanf(“%d%d”,&a,&b);
printf(“enter 1 for sum\n2 for multiply\n3for subtraction\n4 for division: ”);
scanf(“%d”,&n);
switch(n)
{
case 1:
s=a+b; printf(“sum=%d”,s);
break;
case 2:
m=a*b; printf(“multiply=%d”,m);
break;
case 3:
su=a-b; printf(“subtraction=%d”,su);
break;
case 4:
d=a/b; printf(“divission=%d”,d);
break;
default:
printf(“wrong input”);
break;
}
getch();
}
No comments:
Post a Comment