我想破头也不知道该怎么做,应该怎么输入,前面的课程我看了好几遍但还是搞不明白哪里出问题了
搞不明白你为什么用 char来定义result,char应该是来定义字符的吧,比如char result='a';这里就算用也该是int吧
#include<stdio.h>
int main()
{
int x,y;
x=10;
y=-3;
printf("x+y=%d\n",x+y); //printf 是输出 输出“”里面的
printf("x-y=%d\n",x-y);
printf("x*y=%d\n",x*y);
printf("x/y=%d\n",x/y);
printf("x%y=%d\n",x%y);
return 0;
}
#include<stdio.h>
int main()
{
int x,y;
x=10;
y=-3;
printf("x+y=%d\n",x+y); //后边取得地址是运算的式子,因为在输出里计算的结果存在这里了
printf("x-y=%d\n",x-y);
printf("x*y=%d\n",x*y);
printf("x/y=%d\n",x/y);
printf("x%y=%d\n",x%y);
return 0;
}
#include <stdio.h>
int main()
{
int x,y;
x = 10;
y = -3;
printf("x+y=%d\n",x+y);
printf("x-y=%d\n",x-y);
printf("x*y=%d\n",x*y);
printf("x/y=%d\n",x/y);
printf("x%y=%d\n",x%y);
return 0;
}
#include<stdio.h>
int main()
{
int x,y;
x=10;
y=-3;
printf("x+y=%d\n",x+y);
printf("x-y=%d\n",x-y);
printf("x*y=%d\n",x*y);
printf("x/y=%d\n",x/y);
printf("x%y=%d\n",x%y);
return 0;
}
int z =( x*8)/(y+2);