MCQOPTIONS
Bookmark
Saved Bookmarks
→
Structures, Unions, Enums
→
General in Structures, Unions, Enums
→
What will be output for the following code?
..
1.
What will be output for the following code?
A.
error
B.
success
C.
failure
Answer» B. success
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
<p>What will be the output of the program if it is executed like below?<br> cmd> sample</p> <pre> <code>/* sample.c */ #include<stdio> int main(int argc, char **argv) { printf("%s n", argv[argc-1]); return 0; }</stdio></code></pre> <p> </p>
<p>Find the output of below C program</p> <pre> <code>#include "stdio.h" typedef enum{ Male, Female }SEX; int main() { SEX var = Male; printf("%d",var); return 0; }</code></pre> <p> </p>
<p>What is the output of this C code?</p> <pre> <code>#include <stdio> struct student { int no; char name[20]; } void main() { struct student s; s.no = 8; printf("hello"); }</stdio></code></pre> <p> </p>
<p>Which of the following structure declaration will throw an error?</p>
<p>String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.</p>
<p>If we do not explicitly assign values to enum names, the compiler by default assigns values to ?</p>
<p>All enum constants are?</p>
<p>Enumeration (or enum) is a ______ data type in C?</p>
<pre> <code>#include "stdio.h" typedef enum{ Male=5, Female }SEX; int main() { SEX var = Male; SEX var1 = Female; printf("%d %d",var, var1); return 0; }</code></pre> <p> </p>
<p>What will be the output of the following C code if input given is 2?</p> <pre> <code>#include<stdio> enum day { a,b,c=5,d,e }; main() { printf("Enter the value for a"); scanf("%d",a); printf("%d",a); }</stdio></code></pre> <p> </p>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply