Professional Documents
Culture Documents
sense)?
3141592
3.141592
3,141592
3_141_592
012
10
12
18
0x12
10
18
12
the literal is invalid
Alpha-Omega
Alpha@Omega
Alpha:Omega
none of these
_R2D2_
_2R2D_
2R2D
R2D2
int long;
int float;
int int;
int longint;
What is the value of the X variable at the end of the following snippet?
int X = 1;
X = X + 2 * X;
X = X / 2 * X;
X = X + 2 + X;
What is the value of the X variable at the end of the following snippet?
int X = 1;
X = X * X + 2;
X = X / X * 2;
X = X + 2 + X;
Which of the following strings is a proper floating-point number (in the "C"
language sense)?
3.1415M92
3.1415F92
3.1415E92
3.1415X92
-1E-1
-0.01
-1.0
-0.1
What is the value of the X variable at the end of the following snippet?
int X = 1, Y = 2, Z;
Z = X / Y * --X * Y++;
What is the value of the X variable at the end of the following snippet?
int X;
X = 'b' - 'a' * ('\' / '\');
#include <stdio.h>
int main(void) {
int a = -1, b = 1;
return 0;
#include <stdio.h>
int main(void) {
int i = 0;
if(i = 1)
i = 2;
else
i = 3;
printf("%d\n",i);
return 0;
#include <stdio.h>
int main(void) {
int i = 1, j = 2;
x = (int)x / y + (float)i / j;
printf("%f",x);
return 0;
}
Select correct answer (single choice)
#include <stdio.h>
int main(void) {
int i = 16, j = 8;
do {
i /= 2;
j -= i / 2;
printf("%d",i + j);
return 0;
#include <stdio.h>
int main(void) {
int i = 16, j = 6;
while(j > 0) {
i /= 2;
j -= i / 2;
printf("%d",i + j);
return 0;
#include <stdio.h>
int main(void) {
int i = 2, j;
for(j = 0; j < 0; j -= i)
i /= 2;
printf("%d",i + j);
return 0;
}
Select correct answer (single choice)
#include <stdio.h>
int main(void) {
int i = 5, j = 4;
j--;
printf("%d",i + j);
return 0;
#include <stdio.h>
int main(void) {
int i = 1, j = 0, k;
k = (i & j) + (i | j) + (i ^ j) + !i + j;
printf("%d", k);
return 0;
#include <stdio.h>
int main(void) {
int i = 1, j = 0, k;
k >>= i;
printf("%d", k);
return 0;
#include <stdio.h>
int main(void) {
int i = 1, j = i + 2 * i;
switch(j - i) {
case 1: j++;
case 2: j--;
default: j = 0;
printf("%d", ++j);
return 0;
#include <stdio.h>
int main(void) {
int i = 1, j = i + 2 * i;
switch(j) {
default: j = 0;
case 2: j--;
printf("%d", ++j);
return 0;
#include <stdio.h>
int main(void) {
int i, t[4];
t[i] = i;
t[i + 1] = 2 * t[i];
printf("%d\n", t[3]);
return 0;
}
Select correct answer (single choice)
#include <stdio.h>
int main(void) {
int i, t[4];
for(i = 3; i; i--) {
t[i] = i - 1;
t[t[i]] = t[i];
printf("%d\n", t[0]);
return 0;
int main(void) {
s += t[i];
printf("%d\n", s);
return 0;
#include <stdio.h>
int main(void) {
return 0;
#include <stdio.h>
int main(void) {
**c = a + (a == *b);
printf("%c", a);
return 0;
#include <stdio.h>
int main(void) {
int t[4][4];
return 0;
}
Select correct answer (single choice)
#include <stdio.h>
int main(void) {
return 0;
#include <stdio.h>
int main(void) {
char *p = "\0\4\1\3\2";
return 0;
}
#include <stdio.h>
#include <string.h>
int main(void) {
strcpy(tt, tt + 2);
return 0;
#include <stdio.h>
#include <string.h>
int main(void) {
strcat(tt + 2, "987");
return 0;
#include <stdio.h>
#include <stdlib.h>
int main(void) {
t++;
*t = 8;
t[-1] = *t / 2;
t--;
t[1] = *t / 2;
printf("%d\n",*t);
free(t);
return 0;
#include <stdio.h>
int main(void) {
char (*t2)[10];
return 0;
#include <string.h>
struct S {
char S[4];
};
int main(void) {
return 0;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct S {
char *S;
};
int main(void) {
S -> S = "abc";
free(S);
return 0;
#include <stdio.h>
struct S {
int Var;
struct S *Str;
};
int main(void) {
printf("%d", S[2].Str->Str->Var);
return 0;
}
Select correct answer (single choice)
#include <stdio.h>
return *(++t);
int main(void) {
int arr[] = { 8, 4, 2, 1 };
return 0;
#include <stdio.h>
int fun(int t) {
return ++t;
int main(void) {
int arr[] = { 8, 4, 2, 1 };
return 0;
#include <stdio.h>
int f(int v) {
v = 2 * v;
return v * v;
int main(void) {
int i = 2;
f(i);
printf("%d",i);
return 0;
}
Select correct answer (single choice)
#include <stdio.h>
return p++;
return p += 2;
int main(void) {
char *s = "ABCDEFGHIJ";
printf("%d",p - 'A');
return 0;
#include <stdio.h>
struct S {
int S[2];
};
void f(struct S S) {
S.S[0] = S.S[1] + 4;
int main(void) {
struct S S = { { 4, 8 } };
f(S);
printf("%d",S.S[1] / S.S[0]);
return 0;
#include <stdio.h>
struct S {
int S[2];
};
S->S[1] = S->S[0] + 2;
int main(void) {
struct S S = { { 4, 8 } }, *P = &S;
f(P);
printf("%d",S.S[1] / S.S[0]);
return 0;
#include <stdio.h>
int main(void) {
i = f(t);
printf("%d",i);
return 0;
#include <stdio.h>
#include <string.h>
s[p + 1] = '\0';
return s + 1;
int main(void) {
printf("%d\n",i);
return 0;
#include <stdio.h>
int main(void) {
char s[20];
FILE *f = fopen("data","w");
int i = fputs("1248",f);
fclose(f);
f = fopen("data","r");
fgets(s + 2,4,f);
putchar(s[4]);
fclose(f);
return 0;
#include <stdio.h>
#define ABC 10
int main(void) {
int i = 19;
i = i - XYZ;
printf("%d\n", i);
return 0;
void (*f)(int);
void *ptr;
void **ptr;
void ptr;