100 Multiple Choice Questions In C Programming – Part 7
This collection of 100 Multiple Choice Questions and Answers (MCQs) In C Programming : Quizzes & Practice Tests with Answer focuses on “C Programming”.
1. Which of these variable types matches a pointer?
A int
B float *
C long
D char
2. What is the output of the following C program?
#include <stdio.h> void main() { float a = 0.2; printf("%d, ", a); printf("%f", a); }
A 0, 0.999999
B 0, 0.200000
C Junk value, 0.200000
D 0.200000, junk value
[st_adsense]
3. In which order does the compilation occur?
A Preprocessor – Compiler – Linker
B Compiler – Linker – Preprocessor
C Linker – Preprocessor – Compiler
D Preprocessor – Linker – Compiler
4. What is the output of the following C program?
#include <stdio.h> void main() { double a = 14728749.22; int b = a; printf("%d\n", b); printf("%lf\n", b); }
A 1472874, 0.000000
B 1472874, 1472874.0
C 14728749, 14728749.22
D 0, 0.0
5. What is the output of the following C program?
#include <stdio.h> void main() { int a = 97; char b = a; printf("%c\n", b); }
A 97
B b
C a
D Depends on compiler
[st_adsense]
6. When a double is converted to a float, its value is _____?
A Rounded
B Truncated
C Depends on compiler
D Depends on the standard
7. What does the following code give: &A ?
A The address of the variable A
B The value of the variable A
C The value of the variable to which A points
D None of the above
8. What is the output of the following C program?
#include <stdio.h> int main() { int i = 15; char c = -15; if (i < c) printf("15 < -15\n"); else printf("15 > -15\n"); }
A 15 < -15
B 15 > -15
C Depends on compiler
D Depends on the standard
[st_adsense]
9. What does the following code give: *A ?
A The address of the variable A
B The value of the variable A
C The value of the variable to which A points
D None of the above
10. What is the output of the following C program?
#include <stdio.h> void main() { int x = 1, y = 0, z = 5; int a = x && y || z++; printf("%d", z); }
A 0
B 5
C 6
D Other