Time limit: 0
Quiz-summary
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Programming Essentials in C: Chapter 4 Assignment (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 20 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
- Answered
- Review
-
Question 1 of 20
1. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 3, j = i - 2; switch(i - 2) { case 1: j++; case 2: j++; case 0: j++; break; default:j = 0; } printf("%d",j); return 0; } Correct
Incorrect
-
Question 2 of 20
2. Question
1 pointsWhat happens if you try to compile and run this program?#include#include
#include int main(void) { int i = 3, j = i - 2; switch(i + 2) { case 1: j++; case 2: j++; default:j = 0; case 0: j++; break; } printf("%d",j); return 0; } Correct
Incorrect
-
Question 3 of 20
3. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i, t[5]; t[0] = 0; for(i = 1; i < 5; i++) t[i] = t[i - 1] + i; printf("%d",t[4]); return 0; } Correct
Incorrect
-
Question 4 of 20
4. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i, t[5]; t[4] = 0; for(i = 3; i >= 0; i--) t[i] = t[4] * i; printf("%d",t[0]); return 0; } Correct
Incorrect
-
Question 5 of 20
5. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int t[2]; t[0] = 1; t[1] = 0; printf("%d",t[t[t[t[t[0]]]]]); return 0; } Correct
Incorrect
-
Question 6 of 20
6. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i,t[3]; for(i = 2; i >=0 ; i--) t[i] = i - 1; printf("%d",t[1] - t[t[0] + t[2]]); return 0; } Correct
Incorrect
-
Question 7 of 20
7. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i,t[4] = { 1, 2, 4, 8 }; for(i = 0; i < 2 ; i++) t[i] = t[3 - i]; printf("%d",t[2]); return 0; } Correct
Incorrect
-
Question 8 of 20
8. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int s,i,t[] = { 0, 1, 2, 3, 4, 5 }; s = 1; for(i = 2; i < 6 ; i += i + 1) s += t[i]; printf("%d",s); return 0; } Correct
Incorrect
-
Question 9 of 20
9. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char t[] = { 'a', 'b', 'A', 'B' }; printf("%d",t[1] - t[0] + t[3] - t[2]); return 0; } Correct
Incorrect
-
Question 10 of 20
10. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { float t[5] = { 1E0, 1E1, 1E2, 1E3, 1E4 }; printf("%f",t[0] + t[2] + t[3]); return 0; } Correct
Incorrect
-
Question 11 of 20
11. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int i = 1, *j = &i, **k = &j; printf("%d",**k); return 0; } Correct
Incorrect
-
Question 12 of 20
12. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char t[3]; printf("%d",sizeof(t) - sizeof(t[0])); return 0; } Correct
Incorrect
-
Question 13 of 20
13. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int t[6]; printf("%d",sizeof(t) / sizeof(int)); return 0; } Correct
Incorrect
-
Question 14 of 20
14. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int t[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, *p = t + 4; p += *p; printf("%d",*p); return 0; } Correct
Incorrect
-
Question 15 of 20
15. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { int t[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, *p = t; p += 2; p += p[-1]; printf("%d",*p); return 0; } Correct
Incorrect
-
Question 16 of 20
16. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { char s[] = "\0\1\2\3\4"; printf("%c",'A' + s[3]); return 0; } Correct
Incorrect
-
Question 17 of 20
17. Question
1 pointsWhat happens if you try to compile and run this program?#include
int main(void) { printf("%c","ACEGIK"[3] - 1); return 0; } Correct
Incorrect
-
Question 18 of 20
18. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include int main(void) { char s[10] = "ABCDE"; strcpy(s + 2, "ABCDE"); printf("%d", s[0] - s[2]); return 0; } Correct
Incorrect
-
Question 19 of 20
19. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include int main(void) { char s[10] = "CABDE"; strcat(s + 2, "CABDE"); printf("%d", s[0] - s[2]); return 0; } Correct
Incorrect
-
Question 20 of 20
20. Question
1 pointsWhat happens if you try to compile and run this program?#include
#include int main(void) { char s[10] = "ABCDE"; strcat(s + 2, "ABCDE"); printf("%d", s[0] - s[2]); return 0; } Correct
Incorrect