ok i have made a calculator using turbo c but it keeps disappearing when i choose the run command can any body help me please
#include<stdio.h>
#include<conio.h>
int sum (int x,int y)
{
int z;
z=x+y;
return z;
}
int sub (int x,int y)
{
int z ;
z=x-y;
return z;
}
int mult (int x,int y)
{
int z;
z=x*y;
return z;
}
float dev (int x,int y)
{
float z;
z=x/y;
return z;
}
void main ()
{
int a,b,c;
int d;
clrscr();
printf("enter the first integer");
scanf("%d",&a);
printf("enter the second integer");
scanf("%d",&b);
int i=1;
printf("what kined of operation do you wanna apply .please choose from the list:\n%d)addition(+)\n%d)subtract(-)\n%d)multiplitation(*)\n%d)division(/)",i,i+1,i+2,i+3);
scanf("%d",&c);
switch (c)
{
case '1' :
d=sum(a,b);
printf("%d + %d = %d",a,b,d);
break;
case '2':
d=sub(a,b);
printf("%d - %d = %d",a,b,d);
break;
case '3':
d=mult(a,b);
printf("%d * %d = %d",a,b,d);
break;
case '4' :
if (b>0) {
d=dev(a,b);
printf("%d / %d = %d",a,b,d);
}
else if (b<0)
{
d=dev(a,b);
printf("%d / %d = %d",a,b,d);
}
break;
}
getch();
}