

MCQOPTIONS
Saved Bookmarks
This section includes 15 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. |
What will be the output of the program if value given to ? |
A. | 25 |
B. | 2 |
C. | 1 |
D. | 5 |
Answer» D. 5 | |
2. |
Which files will get closed through the in the following program? |
A. | "A.C" "B.C" "C.C" |
B. | "B.C" "C.C" |
C. | "A.C" |
D. | Error in |
Answer» E. | |
3. |
To scan and given below, which of the following statement will you use? |
A. | scanf("%f %f", &a, &b); |
B. | scanf("%Lf %Lf", &a, &b); |
C. | scanf("%f %Lf", &a, &b); |
D. | scanf("%f %lf", &a, &b); |
Answer» E. | |
4. |
Out of and which function is safe to use? |
A. | gets() |
B. | fgets() |
Answer» C. | |
5. |
Consider the following program and what will be content of ? |
A. | size of "DUMMY.C" file |
B. | The handle associated with "DUMMY.C" file |
C. | Garbage value |
D. | Error in fileno() |
Answer» C. Garbage value | |
6. |
are FILE pointers |
A. | Yes |
B. | No |
Answer» B. No | |
7. |
Can we specify a variable filed width in a format string? |
A. | Yes |
B. | No |
Answer» C. | |
8. |
While calling the function in the format string conversion specifier can be used to write a character string in capital letters. |
A. | True |
B. | False |
Answer» C. | |
9. |
Offset used in function call can be a negative number. |
A. | True |
B. | False |
Answer» B. False | |
10. |
We should not read after a write to a file without an intervening call to |
A. | True |
B. | False |
Answer» B. False | |
11. |
In a call to function the format specifier %b can be used to print binary equivalent of an integer. |
A. | True |
B. | False |
Answer» C. | |
12. |
In a file contains the line "I am a boy\r\n" then on reading this line into the array using . What will contain? |
A. | "I am a boy\r\n\0" |
B. | "I am a boy\r\0" |
C. | "I am a boy\n\0" |
D. | "I am a boy" |
Answer» D. "I am a boy" | |
13. |
What is the purpose of in function used below in the code? |
A. | open "source.txt" in binary mode for reading |
B. | open "source.txt" in binary mode for reading and writing |
C. | Create a new file "source.txt" for reading and writing |
D. | None of above |
Answer» B. open "source.txt" in binary mode for reading and writing | |
14. |
What does point to in the program ? |
A. | The first character in the file |
B. | A structure which contains a |
C. | pointer which points to the first character of a file. |
D. | The name of the file. |
E. | The last character in the file. |
Answer» C. pointer which points to the first character of a file. | |
15. |
To print out and given below, which of the following statement will you use? |
A. | printf("%f %lf", a, b); |
B. | printf("%Lf %f", a, b); |
C. | printf("%Lf %Lf", a, b); |
D. | printf("%f %Lf", a, b); |
Answer» B. printf("%Lf %f", a, b); | |