hello.c
#include <stdio.h>
int main()
{
int x,y;
x = 10;
y = -3;
printf("x+y=%d\n", );
printf("x-y=%d\n", );
printf("x*y=%d\n", );
printf("x/y=%d\n", );
printf("x%y=%d\n", );
return 0;
}
本课程编程练习请
hello.c
#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;
}//上面的双引号里的%d意思是输出结果的类型属于带符号十进制整数,实际输出的值在逗号后面。
加上%d所代表的10进制变量
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x,y,t;
x = 10;
y = -3;
t=x+y;
printf("x+y=%d\n",t);
t=x-y;
printf("x-y=%d\n",t);
t=x*y;
printf("x*y=%d\n",t);
t=x/y;
printf("x/y=%d\n",t);
t=x%y;
printf("x%y=%d\n",t);
system("pause");
return 0;
}
//结果