单选题 C语言
题号 #2253837

 
有下列程序: 
#include<stdio.h>
main()
{ int x=0;
int y=0;
while(x<7 &&++v)
{ y--;
x++;}
printf("%d,%d",y,x);
}
程序的输出结果是( )。

进入在线模考

参考答案

A

答案解析


本题考查while循环。在while循环中,y自加每次循环都加l,在循环体内y--每次减1,所以总的y值不变,当x自加到7时,不满足循环条件,循环结束。

你可能感兴趣的试题

A.#define f(x) 5*x*x+5*x+5
B.#define f5*X*x+5*x+5
C.#define f(a) (5*a*a+5*a+5)
D.#define(5*x*x+5*x+5) f(x)
A.将字符串str1复制到字符串str2中后再连接到字符串str3之后
B.将字符串str1连接到字符串str2之后再复制到字符串str3之后
C.将字符串str2复制到字符串str1之后再将字符串str3连接到字符串str1之后
D.将字符串str2连接到字符串str1之后再将字符串strl复制到字符串str3中
找试题 · 找答案 · 找资料 在线模考