What is printed by this C code: void inc(int x) { x++; } int a = 5; inc(a); printf(“%d”, a);?
Correct answer C. 5
Topic / 110 questions
Page 4 of C Language multiple-choice questions with answers. Tap an option to check yourself.
Page 4 of 6
Correct answer C. 5
Correct answer A. 5 15
Correct answer A. 6
Correct answer B. 0
Correct answer D. A negative integer
Correct answer A. dest must hold a null-terminated string and have room for both strings plus one null byte
Correct answer D. dst is not null-terminated
Correct answer A. 5
Correct answer D. 8
Correct answer B. long long
Correct answer C. 0
Correct answer A. <stdint.h>
Correct answer C. int
Correct answer B. -3
Correct answer A. 4
Correct answer D. ?: (conditional operator)
Correct answer A. 1 2
Correct answer D. The comma operator
Correct answer D. -3 -1
Correct answer B. Assignment associates right to left, so c = 4 is evaluated first and its value is assigned onward