printf(%s, a);
printf(%s, 'a');
printf(%c, a);
printf(%d, 'a');
第1题:
根据下列的定义,能打印出字母P的语句是( )
struct stu {char name[10];
int age;
};
stmct stu s[10]={"John",11,
"Paul",12,
"Mary",11,
"adam",12
}:
A.printf("%c",s[3].name);
B.printf("%c",s[3].name[1]);
C.printf("%c",s[2].name[11]);
D.printf("%c",s[1].name[0]);
第2题:
以下说法中,正确的是______。
A.#define和printf都是C语句
B.#define是C语句,而printf不是
C.printf是C语句,但#define不是
D.#define和printf都不是C语句
第3题:
设有定义:long x=-123456L; 则以下能够正确输出变量x值的语句是_______。
A.printf(“x=%d\n”,x)
B.printf(“x=%ld\n”,x)
C.printf(“x=?l\n”,x)
D.printf(“x=%D\n”,x);
第4题:
设有char str[10],下列语句正确的是A.scanf("%s",&str); B.printf("%c",str); C.printf("%s",str[0]); D.printf("%s",str);
第5题:
若变量已正确定义,则以下语句的输出结果是______。 s=32;s^=32;printf("%d",s);
A.-1
B.0
C.1
D.32
第6题:
根据下列的定义,能打印出字母P的语句是( )。 struct stu {char name[10]; int age; }; struct sm s[10]={"John",11, "Pau1",12, "Mary",11, "adam",12 };
A.printf("%c",s[3].name);
B.printf("%c",s[3].name[1]);
C.printf("%c",s[2].name[1]);
D.printf("%c",s[1].name[0]);
第7题:
试题21
以下不恩那个输出字符A的语句时(注:字符A的ASII码值为65,字符a的ASCII码值为97)()
A.printf(“%c\n”,’a’ -32);
B.printf(“%d\n”, ‘A’);
C.printf(“%c\n”,65);
D.printf(“%c\n”, ‘B’- 1);
第8题:
若已定义:int a=5;floatb=63.72;以下语句中能输出正确值的是()
第9题:
要使doublex;longa;的数据能正确的输出,输出语句应是()。
第10题:
已定义了相关变量,若要输出26个大写英文字母正确的输出语句是()
第11题:
设有char*a=”ABCD”;,则printf(“%s”,a)的输出是(),而printf(“%c”,*a)的输出是()。
第12题:
6566456
66656
66666
6666656
第13题:
若有以下说明:chars1[]={"tree"},s2[]={"flower"};,则以下对数组元素或数组的输出语句中,正确的是()。
A.printf("%s%s",s1[5],s2[7]);
B.printf("%c%c",s1,s2);
C.puts(s1);puts(s2);
D.puts(s1,s2);
第14题:
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
A.15
B.16
C.12
D.59
第15题:
有以下程序
#include<stdio.h>
main()
{int s;
scanf(“%d”,&s);
while(s>0)
{switch(s)
{case 1;printf(“%d”,s+5);
case 2:printf(“%d”,s+4);break;
case 3:printf(“%d”。s+3);
default:printf(“%d”,s+1);break;
}
seanf(“%d”,&s);
}
}
运行时,若输入1 2 3 4 5 O<回车>,则输出结果是
A.6566456
B.66656
C.66666
D.6666656
第16题:
char *p="hello";
printf("%s",p);
p++;
printf("%s",p);
printf("%c",*p);
第17题:
以下不能输出字符A的语句是(注:字符A的ASCII码值为65,字符a的ASCII码值为97)
A.printf("%c\n",'a'-32);
B.printf("%d\n",'A');
C.printf("%c\n",65);
D.printf("%c\n",'B'-1);
第18题:
试题19
下列条件语句中,输出结果与其他语句与其他语句不同的是()
A. if(a) printf(“%d\n”,x); else printf(“%d\n”, y);
B. if(a==0) printf(“%d\n”,y); else printf(“%d\n”, x);
C. if(a!=0) printf(“%d\n”,x); else printf(“%d\n”, y);
D.if(a==0) printf(“%d\n”,x); else printf(“%d\n”, y);
第19题:
执行“printf("%s%s%d","wei","rong",18);”语句后得到的输出结果为()。
weirong18
略
第20题:
设有char str〔10〕,下列语句正确的是()
第21题:
printf函数中,%c和%s都可以输出字符串.
第22题:
有字符数组a[80]和b[80],则正确的输出语句是()
第23题:
下面语句正确的是()
第24题:
int*p;*p=20
char*s=”abcdef”;printf(“%s/n”,s)
charstr[]=”abcd”;str++
charstr[]={‘a’,’b’,’c’};printf(“%s”,str)