PROGRAM TO DISPLAY ARITHMETIC OPERATOPRS USING SWITCH CASE

/*PROGRAM TO DISPLAY ARITHMETIC OPERATOPRS USING SWITCH CASE*/
#include<stdio.h>
#include<conio.h>
void main()
{
char n;
clrscr();
printf(“Enter any arithmetic operator: “);
scanf(“%c”,&n);
switch(n)
{
case ‘+’:
printf(“\nThe entered operator is of Addition”);
break;
case ‘-‘:
printf(“\nThe entered operator is of Subtraction”);
break;
case ‘*’:
printf(“\nThe entered operator is of Multiplication”);
break;
case ‘/’:
printf(“\nThe entered operator is of Division”);
break;
case ‘%’:
printf(“\nThe entered operator is of Modulus Division”);
break;
default:
printf(“It is not an arithmetic operator.\nYou have entered a wrong choice”);
}
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *