单项选择题

若运行时给变量x赋值12,则以下程序的运行结果是()。
#include<stdio.h>
main()
int x,y;
scanf("%d",&x);
y=x>12 x+10:x-12;
printf("%d\n",y);

A. 0
B. 22
C. 12
D. 10

<上一题 目录 下一题>
热门 试题

单项选择题
下列的程序用来输出两个字符串前7个字符中对应相等的字符及其位置号,程序空白处应该填写的是()。 #include<stdio.h> main() char s1[]= chinese ,s2[]= japnese ; int i; for(i=0;sl1[i]!=' 0'&&s2[i]!=' 0';i++) if(s1[i]==s2[i]&&i<7) ______,

A. putchar(s2[i]);putchar(i)
B. puts(s1[i],i)
C. printf("%c%d\n",s2[i],i)
D. printf("%c",s1[i]);printf("%d\n",i)

单项选择题
有以下程序: #include<string.h> main() char p[20]='a','d','c','d',q[]= abc ,r[]= abcde strcat(p,r);strcpy(p+strlen(q),q); printf( %d n ,sizeof(p)); 程序运行后的输出结果是()。

A. 9
B. 6
C. 11
D. 7

相关试题
  • 常见的软件开发方法有结构化方法和面向对象...
  • 设有下列程序:#include<stdio.h>#inc...
  • 设有下列程序: #include<stdio.h> ...
  • 以下程序运行后的输出结果是 。 # incl...
  • 以下程序运行后的输出结果是______。...