Feed Headline Animator

Write a program to perform simple arithmetic operation by using switch statement.

Main()
{
int a,b;
char opt;
clrscr();
printf(“Enter any two integer value\n”);
scanf(“%d %d “,&a, &b);
printf(“Enter your option for operation +,-, *, /n”);
scanf(“%c”,opt);
switch(opt)
{
case ‘+’;
printf(“\n\t %d+%d+%d”,a,b,a+b);
break;
case’-‘;
printf(“\n \t %d =%d”, a,b, a-b;
break;
case’*’;
prinff(“\n \t %d+%d=%d”, a,b, a*b);
break;
case’/’;
printf(“\n \t %d %d =%d”,a,b,a/b);
break;
printf(“\n \n press any key to list”);
getch();
}
}


Posted by: Wasim Javed

No comments:

Post a Comment