更多“阅读程序,给出程序的执行结果。 #include <stdio.h> main() { char c1 = ‘a’, c2 = ‘b’ , c3 = ‘c’; printf(“a%cb%cc%c\n”…”相关的问题
第1题
输入并运行以下程序。 #include <stdio.h> main() { char c1,c2; c1=97;c2=98; printf("%c %c\n",c1,c2); printf("%d %d\n",c1,c2); } ① 将第二行改为:int c1,c2;再运行。 ② 再将第三行改为:c1=300;c2=400;再运行。 分析运行结果。
点击查看答案
第2题
以下程序输出的结果是()。 #include <stdio.h> int main() { char c; c=('z'-'a')/3+'B'; putchar(c); return 0; }
点击查看答案
第3题
#include <stdio.h> main() { char c1=‘6’,c2=‘0’; printf("%c,%c,%d\n",c1,c2,c2-c1); } 程序的运行结果为 。
点击查看答案
第4题
4.指出下面程序的语法错误: #include <reg51.h> main(){ a=C; int a=7,C delay(10) void delay();{ cgar i; for(i=O; i<=255; ”++”); }>
点击查看答案
第5题
(3)有以下程序 #include <stdio.h> main() { char b,c; int i; b=′a′; c =′A′; for (i=0; i<6; i++) { if (i%2) putchar(i+b); else putchar(i+c); } printf("\n"); 程序运行后的输出结果是> A、A)abcdef
B、B)ABCDEF
C、C)aBcDeF
D、D)AbCdEf
点击查看答案
第6题
有以下程序: #include <stdio.h> main() { int a1,a2; char c1,c2; scanf("%d%c%d%c",&a1,&c1,&a2,&c2); printf("%d,%c,%d,%c",a1,c1,a2,c2); } 若想通过键盘输入,使得a1的值为12,a2的值为34,c1的值为字符a,c2的值为字符b,程序输出结果是:12,a,34,b 则正确的输入格式是(以下_代表空格, <cr> 代表回车)( )
A、12_a34_b <cr>
B、12_a_34_b <cr>
C、12,a,34,b <cr>
D、12a34b <cr>
点击查看答案
第7题
有以下程序 #include #include<stdio.h> main() { int a,c=246; a=c/10%10; printf("%d",a); } 输出结果是:
点击查看答案
第8题
有以下程序 #include<stdio .h> main() {char s[」=”rstuv"; printf(”%c\n”,*s+2); } 程序运行后的输出结果是
A、tuv
B、t
C、t的字符ASCII码值
D、程序出错
点击查看答案
第9题
#include <stdio.h> int main() {int c1,c2; c1=97; c2=98; printf("c1=%c,c2=%c\n",c1,c2); printf("c1=%d,c2=%d\n",c1,c2); return 0; } 该程序的运行结果是
点击查看答案
第10题
若有以下程序 #include <stdio.h> main(){ int a=1,b=2,c=3,d=4,r=0; if(a!=1) ; else r=1; if(b==2) r+=2; else; if(c!=3) r+=3; else; if(d==4) r+=4; printf("%d\n",r); }
点击查看答案