青岛理工大学
- 以下程序执行后输出的结果是( )。#include "stdio.h"main() { int i=1,s=0; do { if(i%3){i+=2;continue;} s+=i; i++; } while(i<8); printf("%d\n",s); }
- 若运行时给变量x输入12,则以下程序的运行结果是( )。#include "stdio.h"main(){ int x,y; scanf("%d",&x);y=x>12?x+10:x-12;printf("%d\n",y); }
- 在C语言中,要求运算数必须是整型的运算符是( )
- 以下选项中可用作C程序合法实数的是( )。
- 若要求定义具有10个int型元素的一维数组a,则以下定义语句中错误的是()。
- 以下程序的运行结果是( )。#include "stdio.h"void fun(int x, int y, int z){ y=x+5; z=x*y; x=z-y;}main( ){ int x=10,y=20,z=30; fun(z,y,x); printf("%d,%d,%d",x,y,z);}
- 以下程序的运行结果是( )。#include "stdio.h"main() { int p[7]={11,13,14,15,16,17,18},i=0,k=0; while(i<7&&p[i]%2) {k=k+p[i]; i++;} printf("%d ",k); }
- 下列不正确的转义字符是( )。
- 若有代数式3ae/(bc),则不正确的C语言表达式是 ( )。
- 以下程序段中的变量已正确定义 for(i=0; i<4; i++, i++) for(k=1; k<3; k++) printf("*");程序段输出的结果是( )。
- 要判断char类型变量m是否为数字字符,可以使用下列表达式( )。
- 若执行下面的程序时从键盘上给a,b分别赋值4和5,则输出结果是( )。#include 'stdio.h'main(){ int a,b,s; scanf('%d%d',&a,&b); s=a; if(a
A:5 B:4 C:16 D:25- 以下C语言用户标识符中,不合法的是( )。
A:AaBc
B:a_b
C:_1
D:a--b
- 以下选项中,当x为大于1的奇数时,值为0的表达式为( )。
- 语句while(x%3) a++; 中的表达式x%3等价于( )。
- 下列程序的输出结果是( )。#include "stdio.h" main() { int a=15,x=20; if(x==a) printf("%d ", x); else printf("%d ", x); }
- 以下程序执行后的输出结果是( )。#include "stdio.h"main( ){int k=2,s=0;switch(k) { case 1: s+=10; break; case 2: s+=20; break; default: s+=3;}printf("%d\n",s);}
- 以下程序执行后的输出结果是( )。#include "stdio.h"main() { int m,i; for(i=1;i<=50;i++) { m=i; if(m%2==0) if(m%3==0) if(m%7==0) printf("%d ",m); } }
- "AA"在内存中占据的字节数是( )。
- 以下程序执行时输入Language Programming的结果是( )。#include "stdio.h"#include "string.h"main(){ char str[30]; gets(str); printf("%s",str);}
- 有定义语句:char s[10];,若要从终端给 s 输入5个字符,错误的输入语句是( )。
- 以下程序运行后的输出结果是( )。#include "stdio.h"main(){int a[8]={11,12,13,14,15,16,17,18},i=1,s=0; while(i<7){ if(a[i]%3) s+=a[i]; i++;} printf("%d ",s); }
- 表示数学关系a≥b>c的C语言表达式形式为( )。
- 以下程序的输出结果是( )。#include "stdio.h"main( ){ int i,j,k; for(i=1;i<3;i++) for(j=1;j<3;j++) { if (i!=j) { k=i*10+j; printf("%d ",k); } }}
- 下列变量定义中合法的是( )。
- 以下叙述中不正确的是( )。
- 以下程序的执行结果是( )。#include "stdio.h"main(){ int a=10, y=10; do { a+=4; y+=a; printf("a=%d,y=%d ",a,y); if(y>20) break; } while(a==14);}
- 以下程序运行后的输出结果是( )。#include "stdio.h"main(){ char a; for(a=0; a<15; a+=5) { putchar(a+'A');}}
- 设x和y均为int型变量,则执行下列循环后,y值为( )。for(y=1,x=1;y<=50;y++){ if(x>=10) break; x+=3;}
- 以下程序的运行结果是( )。#include "stdio.h"int a, b;void fun( ){ a=10; b=20; }main( ){ int a=5, b=7; fun( ); printf("%d %d", a,b);}
- 设a、b和c都是int型变量,且a=3,b=4,c=5,则下面的表达式中,值为0的表达式是( )。
- 以下程序的输出结果是( )。#include "stdio.h"main() { int p,a=5; if(p=a!=0) printf("%d\n",p); else printf("%d\n",p+2); }
- 下面程序的功能是:输入一些整数,编程计算并输出其中所有正数的和,输入负数时不累加,继续输入下一个数。输入零时,表示输入数据结束。要求最后统计出累加的项数。在[【1】处填写适当的表达式,使程序完整并符合题目要求。 #include "stdio.h"main(){ int i=0,n,sum=0; printf("Input a number:"); scanf("%d",&n); while(【1】) {if(n>0) {sum=sum+n;i++;} printf("Input a number:"); scanf("%d",&n); } printf("sum=%d,count=%d\n",sum,i);}
- 循环语句for(i=0,j=0;(j!=4)||(i<3);i++); 的循环次数是( )
- 以下程序运行后的输出结果是( )。#include "stdio.h"main(){ char a='H';a=(a>='A' && a<='Z')? (a+'a'-'A'): a;printf(" %c\n", a);}
- 设ch是char型变量,其值为a,且有下面的表达式:ch=(ch>='a'&&ch<='z')?(ch-32):ch上面表达式的值是( )。
- 以下错误的定义语句是( )。
- 以下程序的输出结果是( )。#include "stdio.h"main( ){ int a[3][3]={{1,2},{3,4},{5,6}},i,j,s=0; for(i=1;i<3;i++) for(j=0;j<=i;j++) s+=a[i][j]; printf("%d\n",s);}
- 下面程序运行的结果是( )。 #include "stdio.h"main(){char ch[7]={ "89cd51"}; int i,s=0; for(i=0;ch[i]>='0'&&ch[i]<='9';i++) s=10*s+ch[i]-'0'; printf("%d ",s); }
- 给出以下定义:char str1[ ]="1234567";char str2[ ]={'1','2','3','4','5','6','7'};则正确的叙述为( )。
A:12 B:9 C:21 D:16
答案:9
A:0 B:22 C:12 D:10
答案:0
A:/ B:< C:! D:%
答案:%
A:
E9
B:9.12E
C:.1e3
D:3.0e0.2答案:.1e3
A:
int n=10,a[n];
B:#define n 5
int a[2*5];
int a[5+5];
D:#define N 10
int a[N];
答案:int n=10,a[n];
A:
10,20,30
B:565,35,600
C:15200185
D:30,20,10
答案:10,20,30
A:
56
B:45
C:24
D:58
答案:24
A:
'067'
B:‘\\’
C:'\t'
D:'\x8a'
答案:'067'
A:
a/b/c*e*3
B:3*a*e/b/c
C:a*e/c/b*3
D:3*a*e/b*c
答案:3*a*e/b*c
A:
********
B:****
C:**
D:*
A:0<=m && m<=9 B:'0’<=m || m<='9’ C:'0’<=m && m<='9’ D:
'0'<=m & m<='9’
A:
x%2==1
B:x%2!=0
C:x%2==0
D:x/2
A:x%3!=0 B:x%3==1 C:x%3==2 D:x%3==0
A:20 B:1 C:15 D:0
A:10 B:23 C:30 D:20
A:41 B:42 C:28 D:27
A:2 B:4 C:3 D:1
A:Language B:Language, Programming C:Language Programming D:Programming
A:
gets(&s[0]);
B:gets(s);
C:scanf("%s", s);
D:scanf("%s", s[0]);
A:60 B:45 C:71 D:27
A:
(a>=b)&&(b>c)
B:(a>=b)&(b>c)
C:(a>=b)AND(b>c)
D:(a>=b>c)
A:21 22 31 32 B:12 21 C:11 22 D:11 12 21 22
A:
double b=1+5e2.5;
B:float 2_and=1e-3; C:short _a=12; D:long do=0x12L;
A:在一个函数内的复合语句中定义的变量在本函数范围内有效 B:函数中的形式参数是局部变量 C:在一个函数内定义的变量只在本函数范围内有效 D:在不同的函数中可以使用相同名字的变量
A:a=14,y=34 B:a=18,y=28 C:a=14,y=24 D:a=18,y=42
A:
A0
B:A5
C:A10
D:AFK
A:6 B:8 C:2 D:4
A:
5 7
B:10 20
C:7 5
D:20 10
A:
'a'&&'b'
B:a<=b
C:a||b+c&&b-c D:!((a<b)&&!c||1)
A:1 B:3 C:5 D:2
A:
n<0
B:n!=0
C:1
D:n==0
A:
2次
B:3次
C:4次
D:无限次
A:a B:h C:H D:A
A:Z B:a C:z D:A
A:
int x[4][3]={{1,2,3},{1,2,3},{1,2,3}{1,2,3}};
B:int x[][3]={{0},{1},{1,2,3}};
C:int x[][3]={1,2,3,4};
D:int x[3][3]= {{1,2,3},{1,2,3},{1,2,3}{1,2,3}};
A:
18
B:21
C:20
D:19
A:
8951
B:89cd51
C:85
D:89
A:
数组str1和数组str2等价
B:数组str1的长度小于数组str2的长度 C:数组str1的长度大于数组str2的长度 D:数组str1和数组str2的长度相同
温馨提示支付 ¥5.00 元后可查看付费内容,请先翻页预览!