#include <stdio.h>
int
main()
{
float
x,y;
printf
(
"x+y=%f\n"
,x+y);
printf
(
"xy=%f\n"
,xy);
printf
(
"x*y=%f\n"
,x*y);
printf
(
"x/y=%f\n"
,x/y);
printf
(
"x%%y=%f\n"
,x%y);
return0;
}
%的运算对象只能是整形
#include<stdio.h>
int main(){
float x = 1.2, y = 1.3;
float num = x+y;
float nub = x-y;
float nus = x*y;
float nuz = x/y;
printf("x+y=%f \n",num);
printf("x-y=%f \n",nub);
printf("x*y=%f \n",nus);
printf("x/y=%f \n",nuz);
}
可能是你有两个取模符号或者是你的类型是float。。。