

MCQOPTIONS
Saved Bookmarks
This section includes 18 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
In the following C program everytime program is run different numbers are generated.
|
A. | Depends on the platform |
B. | Depends on the compiler |
C. | True |
D. | False |
E. | None of these |
Answer» D. False | |
2. |
In the below program everytime program is run different numbers are generated.
|
A. | Depends on the platform |
B. | True |
C. | False |
D. | Depends on the compiler |
E. | None of these |
Answer» D. Depends on the compiler | |
3. |
What will be the output of the following C code?
|
A. | A double in the range 0 to 1 |
B. | A float in the range 0 to 1 |
C. | Compilation Error |
D. | An integer in the range 0 to RAND_MAX |
E. | None of these |
Answer» E. None of these | |
4. |
What will be the output of the following C code?
|
A. | A double in the range 0 to 12000 |
B. | Compilation Error |
C. | An integer in the range 0 to 12000 |
D. | A float in the range 0 to 1 |
E. | None of these |
Answer» C. An integer in the range 0 to 12000 | |
5. |
What will be the output of the following C code?
|
A. | A double in the range 0 to 1 |
B. | Compilation Error |
C. | A float in the range 0 to 1 |
D. | An integer in the range 0 to RAND_MAX |
E. | None of these |
Answer» E. None of these | |
6. |
What will be the output of the following C code?
|
A. | 500 |
B. | Compilation Error |
C. | Garbage value |
D. | An integer between 0-499 including 0 and 499 |
E. | None of these |
Answer» E. None of these | |
7. |
What will be the output of the following C code?
|
A. | Whatever is typed by the user first time |
B. | Undefined behaviour |
C. | Compilation Error |
D. | Whatever is typed by the user second time |
E. | None of these |
Answer» C. Compilation Error | |
8. |
Which of the following is the correct syntax for calling function ungetc?
|
A. | ungetc(*fp,c); |
B. | ungetc(c,*fp); |
C. | ungetc(c, fp); |
D. | ungetc(fp, c); |
E. | None of these |
Answer» D. ungetc(fp, c); | |
9. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Undefined behaviour |
C. | 15 |
D. | 15.000000 |
E. | None of these |
Answer» E. None of these | |
10. |
What will be the output of the following C code?
|
A. | Undefined behaviour |
B. | 1.000000 |
C. | Compilation Error |
D. | 0.893997 |
E. | None of these |
Answer» E. None of these | |
11. |
What will be the output of the following C statement?
|
A. | file |
B. | fp |
C. | Nothing |
D. | Either c or EOF for an error |
E. | None of these |
Answer» E. None of these | |
12. |
What does the ungetc function return for the following C expression?
|
A. | Either returns character c or returns EOF for an error |
B. | It returns EOF for an error |
C. | It returns character c |
D. | Both returns EOF for an error and returns character c |
E. | None of these |
Answer» B. It returns EOF for an error | |
13. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 16 |
C. | 4 |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
14. |
What will be the output of the following C code?
|
A. | -65 |
B. | Compilation Error |
C. | Garbage value |
D. | 65 |
E. | None of these |
Answer» E. None of these | |
15. |
What will be the output of the following C code?
|
A. | 10 |
B. | Compilation Error |
C. | 2.302585 |
D. | 1.000000 |
E. | None of these |
Answer» E. None of these | |
16. |
What will be the output of the following C code considering user typed ajit?
|
A. | Undefined behaviour |
B. | jit |
C. | Compilation Error |
D. | ajit |
E. | None of these |
Answer» E. None of these | |
17. |
What will be the output of the following C code?
|
A. | First character of whatever user types first time and whatever user types second time |
B. | Whatever string user types first time |
C. | Whatever string user types second time |
D. | Compilation Error |
E. | None of these |
Answer» B. Whatever string user types first time | |
18. |
What will be the output of the following C code?
|
A. | 4 |
B. | 2 |
C. | 16 |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |