Time limit: 0
Quiz-summary
0 of 50 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
Information
Programming Essentials in C: FINAL TEST (CLA) Test Online
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 50 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- Answered
- Review
-
Question 1 of 50
1. Question
1 pointsWhich of the following strings is a proper integer number (in the “C” language sense)?Correct
Incorrect
-
Question 2 of 50
2. Question
1 pointsWhat is the value of the following integer literal?012
Correct
Incorrect
-
Question 3 of 50
3. Question
1 pointsWhat is the value of the following integer literal?0x12
Correct
Incorrect
-
Question 4 of 50
4. Question
1 pointsWhich of the following strings is a valid variable name?Correct
Incorrect
-
Question 5 of 50
5. Question
1 pointsWhich of the following strings is an invalid variable name?Correct
Incorrect
-
Question 6 of 50
6. Question
1 pointsWhich of the following declarations is valid?Correct
Incorrect
-
Question 7 of 50
7. Question
1 pointsWhat 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;
Correct
Incorrect
-
Question 8 of 50
8. Question
1 pointsWhat 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;
Correct
Incorrect
-
Question 9 of 50
9. Question
1 pointsWhich of the following strings is a correct floating-point number (in the “C” language sense)?Correct
Incorrect
-
Question 10 of 50
10. Question
1 pointsWhat is the value of the following floating-point literal?Correct
Incorrect
-
Question 11 of 50
11. Question
1 pointsWhat 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++;
Correct
Incorrect
-
Question 12 of 50
12. Question
1 pointsWhat is the value of the X variable at the end of the following snippet?int X; X = 'b' - 'a' * ('\' / '\');
Correct
Incorrect
-
Question 13 of 50
13. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int a = -1, b = 1; float i = 2.0, j = -2.0; printf("%d\n", (a > b) + (b > a) + (i > j) + (j > i) + ('z' > 'a')); return 0; } Correct
Incorrect
-
Question 14 of 50
14. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 0; if(i = 1) i = 2; else i = 3; printf("%d\n",i); return 0; } Correct
Incorrect
-
Question 15 of 50
15. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { float x = 3.0, y = 2.0; int i = 1, j = 2; x = (int)x / y + (float)i / j; printf("%f",x); return 0; } Correct
Incorrect
-
Question 16 of 50
16. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 16, j = 8; do { i /= 2; j -= i / 2; } while(j > 0); printf("%d",i + j); return 0; } Correct
Incorrect
-
Question 17 of 50
17. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 16, j = 6; while(j > 0) { i /= 2; j -= i / 2; } printf("%d",i + j); return 0; } Correct
Incorrect
-
Question 18 of 50
18. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 2, j; for(j = 0; j < 0; j -= i) i /= 2; printf("%d",i + j); return 0; } Correct
Incorrect
-
Question 19 of 50
19. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 5, j = 4; for(i--; i--; i--) j--; printf("%d",i + j); return 0; } Correct
Incorrect
-
Question 20 of 50
20. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 1, j = 0, k; k = (i & j) + (i | j) + (i ^ j) + !i + j; printf("%d", k); return 0; } Correct
Incorrect
-
Question 21 of 50
21. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 1, j = 0, k; k = (i << j) + (j << i) + (i << i) + (j << j); k >>= i; printf("%d", k); return 0; } Correct
Incorrect
-
Question 22 of 50
22. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 1, j = i + 2 * i; switch(j - i) { case 1: j++; case 2: j--; case 0: j++; break; default: j = 0; } printf("%d", ++j); return 0; } Correct
Incorrect
-
Question 23 of 50
23. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 1, j = i + 2 * i; switch(j) { default: j = 0; case 1: j++; break; case 2: j--; case 0: j++; break; } printf("%d", ++j); return 0; } Correct
Incorrect
-
Question 24 of 50
24. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i, t[4]; for(i = 0; i < 3; i++) { t[i] = i; t[i + 1] = 2 * t[i]; } printf("%d\n", t[3]); return 0; } Correct
Incorrect
-
Question 25 of 50
25. Question
1 pointsWhat happens if you try to compile and run this program?#include
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; } Correct
Incorrect
-
Question 26 of 50
26. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i, s = 0, t[] = {0, 1, 2, 4, 8, 16}; for(i = 2; t[i] < 8; i *= 2) s += t[i]; printf("%d\n", s); return 0; } Correct
Incorrect
-
Question 27 of 50
27. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char t[] = { 'a', 'z', 'B', 'Z', '0' }; printf("%d\n", t[t[1] - t[0] - t[3] + t[2] + 3] - t[4]); return 0; } Correct
Incorrect
-
Question 28 of 50
28. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char a = 'A', *b = &a, **c = &b; **c = a + (a == *b); printf("%c", a); return 0; } Correct
Incorrect
-
Question 29 of 50
29. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int t[4][4]; printf("%d\n",sizeof(t) / sizeof(t[0]) / sizeof(t[0][0])); return 0; } Correct
Incorrect
-
Question 30 of 50
30. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int t[4] = { 0, -1, -2, -3 }, *p = t + 3; printf("%d\n", p[*p] - t[2]); return 0; } Correct
Incorrect
-
Question 31 of 50
31. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char *p = "\0\4\1\3\2"; printf("%d\n", p[p[1]] + *(p + 1) + p[4]); return 0; } Correct
Incorrect
-
Question 32 of 50
32. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include int main(void) { char tt[20] = "0123456789"; strcpy(tt, tt + 2); printf("%d\n", strlen(tt) - tt[9] + '5'); return 0; } Correct
Incorrect
-
Question 33 of 50
33. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include int main(void) { char tt[20] = "0123456789"; strcat(tt + 2, "987"); printf("%d\n", strlen(tt) - tt[5] + '0'); return 0; } Correct
Incorrect
-
Question 34 of 50
34. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include int main(void) { int *t = (int *) malloc(sizeof(int) + sizeof(int)); t++; *t = 8; t[-1] = *t / 2; t--; t[1] = *t / 2; printf("%d\n",*t); free(t); return 0; } Correct
Incorrect
-
Question 35 of 50
35. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char *t1 [10]; char (*t2)[10]; printf("%d",(sizeof(t1) == sizeof(t2)) + sizeof(t1[0])); return 0; } Correct
Incorrect
-
Question 36 of 50
36. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include struct S { char S[4]; }; int main(void) { struct S S = { 'a', 'b' }; printf("%d", sizeof(S.S) - strlen(S.S) + S.S[3]); return 0; } Correct
Incorrect
-
Question 37 of 50
37. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include #include struct S { char *S; }; int main(void) { struct S *S = (struct S *) malloc(sizeof(struct S)); S -> S = "abc"; printf("%d", strlen(S -> S + 2) + S -> S[3]); free(S); return 0; } Correct
Incorrect
-
Question 38 of 50
38. Question
1 pointsWhat happens if you try to compile and run this program?#include
struct S { int Var; struct S *Str; }; int main(void) { struct S S[] = { { 8, NULL }, { 4, &S[0] }, { 2, &S[1] } }; printf("%d", S[2].Str->Str->Var); return 0; } Correct
Incorrect
-
Question 39 of 50
39. Question
1 pointsWhat happens if you try to compile and run this program?#include
int fun(int *t) { return *(++t); } int main(void) { int arr[] = { 8, 4, 2, 1 }; printf("%d\n", fun(arr + 2)); return 0; } Correct
Incorrect
-
Question 40 of 50
40. Question
1 pointsWhat happens if you try to compile and run this program?#include
int fun(int t) { return ++t; } int main(void) { int arr[] = { 8, 4, 2, 1 }; printf("%d\n", fun(arr[3]) + arr[2]); return 0; } Correct
Incorrect
-
Question 41 of 50
41. Question
1 pointsWhat happens if you try to compile and run this program?#include
int f(int v) { v = 2 * v; return v * v; } int main(void) { int i = 2; f(i); printf("%d",i); return 0; } Correct
Incorrect
-
Question 42 of 50
42. Question
1 pointsWhat happens if you try to compile and run this program?#include
char *f(char *p) { return p++; } char *g(char *p) { return p += 2; } int main(void) { char *s = "ABCDEFGHIJ"; char p = *f(g(f(s + 6))); printf("%d",p - 'A'); return 0; } Correct
Incorrect
-
Question 43 of 50
43. Question
1 pointsWhat happens if you try to compile and run this program?#include
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; } Correct
Incorrect
-
Question 44 of 50
44. Question
1 pointsWhat happens if you try to compile and run this program?#include
struct S { int S[2]; }; void f(struct S *S) { 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; } Correct
Incorrect
-
Question 45 of 50
45. Question
1 pointsWhat happens if you try to compile and run this program?#include
int f(int t[][2]) { return t[0][0] + t[0][1]; } int main(void) { int i,t[2][2] = { {0,4},{4,2} }; i = f(t); printf("%d",i); return 0; } Correct
Incorrect
-
Question 46 of 50
46. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include char *f(int p, char *s) { s[p + 1] = '\0'; return s + 1; } int main(void) { char s[] = "ABCDEF"; int i = strlen(f(1,s + 2)); printf("%d\n",i); return 0; } Correct
Incorrect
-
Question 47 of 50
47. Question
1 pointsWhat happens if you try to compile and run this program?#include
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; Correct
Incorrect
-
Question 48 of 50
48. Question
1 pointsWhat happens if you try to compile and run this program?#include
#define ABC 10 #define XYZ ABC - 1 int main(void) { int i = 19; i = i - XYZ; printf("%d\n", i); return 0; } Correct
Incorrect
-
Question 49 of 50
49. Question
1 pointsWhat is the meaning of the following declaration?void (*f)(int);
Correct
Incorrect
-
Question 50 of 50
50. Question
1 pointsSelect the correct form for the following declaration: ptr is a pointer to pointer to voidCorrect
Incorrect