include<stdio.h>
void main() { int x,y; char ch; do{ printf("\n press '1' for addition"); printf("\n press '2' for substraction"); printf("\n press '0' for exit \n"); scanf("%c",&ch); if(ch=='1'||ch=='2') { printf("enter the values of x and y \n"); scanf("%d%d",&x,&y); } switch(ch) { case '1':printf("addtion=%d",(x+y)); break; case '2':printf("substraction=%d",(x-y)); break; case '0': break; default: printf("incorrect entry"); break; }
} while(ch!='0'); getch();
}