MCQOPTIONS
Saved Bookmarks
This section includes 8 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. |
log(x) function defined in math.h header file is __________. |
| A. | Logarithm to the base 2 |
| B. | Logarithm to the base 10 |
| C. | Natural base logarithm |
| D. | All of above |
| E. | None of these |
| Answer» D. All of above | |
| 2. |
Which among the following mathematical function do not have a double return-type? |
| A. | floor(x); |
| B. | ceil(x); |
| C. | both ceil(x); and floor(x); |
| D. | srand(x); |
| E. | None of these |
| Answer» D. srand(x); | |
| 3. |
Symbolic constant EOF is defined in which header file? |
| A. | conio.h |
| B. | math.h |
| C. | stdio.h |
| D. | string.h |
| Answer» D. string.h | |
| 4. |
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 | |
| 5. |
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 | |
| 6. |
ungetc() is used __________. |
| A. | nothing |
| B. | to get an int |
| C. | to get a char |
| D. | to push a character back to file |
| E. | None of these |
| Answer» E. None of these | |
| 7. |
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); | |
| 8. |
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 | |