

MCQOPTIONS
Saved Bookmarks
This section includes 4 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. |
Which of the following is the correct output for the program given below? #include <studio.h>int main(){enum result {pass, fail, waiting};enum result result1, result2, result3;stud1 = pass;stud2 = waiting;stud3 = fail;printf("%d %d %d n",result1, result2, result3);return 0;} |
A. | 0 1 2 |
B. | 1 2 3 |
C. | 0 2 1 |
D. | 1 3 2 |
Answer» D. 1 3 2 | |
2. |
Which of the following is correct about emp used in the declaration given below ?typedef enum employ {Engineer, Doctor, Manager} emp; |
A. | It is a typedef for enum employ. |
B. | It is a variable of type enum employ. |
C. | The statement is erroneous. |
D. | It is a structure. |
E. | It is one of the elements of enum employ. |
Answer» B. It is a variable of type enum employ. | |
3. |
Which of the following is correct about |
A. | It is a typedef for enum employ. |
B. | It is a variable of type enum employ. |
C. | The statement is erroneous. |
D. | It is a structure. |
E. | It is one of the elements of enum employ. |
Answer» B. It is a variable of type enum employ. | |
4. |
Which of the following is the correct output for the program given below? |
A. | 0 1 2 |
B. | 1 2 3 |
C. | 0 2 1 |
D. | 1 3 2 |
Answer» D. 1 3 2 | |