以下C程序正确的运行结果是 。
main()
{ long y=-43456;
printf ("y=%-8ld\n",y);
printf ("y=%-08ld\n",y);
printf ("y=%08ld\n",y);
printf ("y=%+8ld\n",y);
}: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+43456|y=□□-43456 y=-□□43456 y=-0043456 y=-43456
main()
{ long y=-43456;
printf ("y=%-8ld\n",y);
printf ("y=%-08ld\n",y);
printf ("y=%08ld\n",y);
printf ("y=%+8ld\n",y);
}: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+43456|y=□□-43456 y=-□□43456 y=-0043456 y=-43456
举一反三
- 以下C程序正确的运行结果是 。 main() { long y=-43456; printf ("y=%-8ld ",y); printf ("y=%-08ld ",y); printf ("y=%08ld ",y); printf ("y=%+8ld ",y); }: y=-43456 y=-43456 y=-0043456 y=+□-43456|y=-43456 y=-43456 y=-0043456 y=□□-43456|y=□□-43456 y=-0043456 y=00043456 y=+434
- 以下C程序正确的运行结果是 。main(){ long y=-43456;...tf ("y=%+8ld",y);}
- 选择出合法的if语句(设intx,y;)()。 A: if(x!=y)if(x>y)printf("x>y\n"); else printf("x<y\n"); elseprintf("x==y\n"); B: if(x!=y) if(x>y)printf("x>y\n") else printf("x<y\n"); else printf("x==y\n"); C: if(x!=y)if(x>y)printf("x>y\n"); else printf("x<y\n") else printf("x==y\n"); D: if(x!=y) if(x>y) printf("x>y\n"); else printf("x<y\n") else printf("x= =y\n");
- 以下程序中,运行结果是36的有()。 A: include <stdio.h> B: define M(y) y*y int main() { printf("%d\n",M(6+0)); return 0; } C: include <stdio.h> D: define M(y) (y)*(y) int main() { printf("%d\n",M(6+0)); return 0; } E: include <stdio.h> int M(int y) { return y*y; } int main() { printf("%d\n",M(6+0)); return 0; } F: include <stdio.h> int M(int y) { return (y)*(y); } int main() { printf("%d\n",M(6+0)); return 0; }
- 下面两条if语句合并成一条if语句为( )。 if(a<=b) x=1; else y=2; if(a>b) printf("**y=%d\n",y); else printf("##x=%d\n",x); A: if(a<=b){ x=1; printf(" B: C: x=%d\n",x); } else{ y=2; printf("**y=%d\n",y); } D: if(a<=b) x=1; printf(" E: F: x=%d\n",x); else y=2; printf("**y=%d\n",y); G: if(a<=b){ x=1; printf("**y=%d\n",y); } else{ y=2; printf(" H: I: x=%d\n",x); } J: if(a>b){ x=1; printf(" K: L: x=%d\n",x); } else{ y=2; printf("**y=%d\n",y); }