black

C语言程序设计

登录

填空题

下列程序由两个文件组成,其运行结果是()。
/* 文件 1 */
int x;
sub()
{x=4;   }
/* 文件 2 */
static int x=2;
main()
{sub();printf(“x=%d\n”,x);   }

【参考答案】

x=2

相关考题

填空题 下列程序的输出结果是()。 #include main() { int x=1 0; { int x=20; printf(“%d,”,x); } printf(“%d\n”,x); }

问答题 #include static int a=5; main() { printf(“a=%d\n”,a); p1 (); p2();} p1 () { printf(“a*a=%d\n”,a*a); a=2;} p2() { printf(“a*a*a=%d\n”,a*a*a);} 请写出程序的输出结果。

填空题 下列程序的输出结果是()。 main() { int a=3,b=2,c=1 ;c-=++b; b*=a+c; { int b=5,c=1 2; c/=b*2; a-=c; printf(“%d,%d,%d,”,a,b,c); a+=--c; } printf(“%d,%d,%d\n”,a,b,c); }

All Rights Reserved 版权所有©PP题库网库(pptiku.com)

备案号:湘ICP备14005140号-5

经营许可证号:湘B2-20140064