#include<stdio.h>
#include<conio.h>
int main()
{
char operators;
double a,b;
printf("Enter a operator from the following(+,-,*,/,%): ");
scanf("%c",&operators);
printf("Enter the two values: ");
scanf("%lf,%lf", &a,&b);
switch (operators)
{
case '+':
printf("%lf+%lf=%lf",a,b,a+b);
break;
case'-' :
printf("%lf_%lf=%lf",a,b,a-b);
break;
case '*':
printf("%lf*%lf=%lf",a,b,a*b);
break;
case '/':
printf("%lf/%lf=%lf",a,b,a/b);
break;
/*modulo division*/
case '%':
printf("%lf%%lf=%lf",a,b,a%b);
break;
default:
printf("you have entered a wrong operator.please check and come again");
}
Мне нужно выполнить деление по модулю в операторе switch.