C语言求余数问题#include<stdio.h>main(){ int x,y,a,b,c; float d,e; printf("Please input x and y:\n"); scanf("%d%d",&x,&y); a=x+y; b=x-y; c=x*y; d=(float)x/y; e=x%y; printf("x+y=%d\n",a); printf("x-y=%d\n",b); printf("x*y=%d\n",c);

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 13:14:07
C语言求余数问题#include<stdio.h>main(){ int x,y,a,b,c; float d,e; printf(
xRN@+?fH) VU}AJXm i&ڂ[ gzH (,Қu-?齌kCz ÐZ*~#[>Ot

C语言求余数问题#include<stdio.h>main(){ int x,y,a,b,c; float d,e; printf("Please input x and y:\n"); scanf("%d%d",&x,&y); a=x+y; b=x-y; c=x*y; d=(float)x/y; e=x%y; printf("x+y=%d\n",a); printf("x-y=%d\n",b); printf("x*y=%d\n",c);
C语言求余数问题
#include<stdio.h>main(){ int x,y,a,b,c; float d,e; printf("Please input x and y:\n"); scanf("%d%d",&x,&y); a=x+y; b=x-y; c=x*y; d=(float)x/y; e=x%y; printf("x+y=%d\n",a); printf("x-y=%d\n",b); printf("x*y=%d\n",c); printf("x/y=%f\n",d); printf("x%y=%f\n",e); } 输入x=12,y=5结果显示x%y=%f怎么办?

C语言求余数问题#include<stdio.h>main(){ int x,y,a,b,c; float d,e; printf("Please input x and y:\n"); scanf("%d%d",&x,&y); a=x+y; b=x-y; c=x*y; d=(float)x/y; e=x%y; printf("x+y=%d\n",a); printf("x-y=%d\n",b); printf("x*y=%d\n",c);
C语言里对于有一些符号是不能直接输出的,因为被C语言占用了.所以有一些符号是需要特殊的方式才能输出的.比如你说的%号,%号在C语言里是求余数的符号,如果需要输出%的话,你需要连续写2个%才能输出.如:printf("x%%y=%f\n",e);