C Program questions
2,098 questionsPractice questions from C Program.
Filter questions
mediummultiple choiceC Preprocessor1 points
What is the result of the #pragma message directive in C preprocessing?
Points: 1
mediummultiple choiceC Preprocessor1 points
What will be the output of the following C code? #include #define hello 10 main() { #ifdef hello #undef hello #define hello 100 #else #define hello 200 #endif printf("%d",hello); }
Points: 1
mediummultiple choiceC Preprocessor1 points
The preprocessor directive which is used to remove the definition of an identifier which was previously defined with #define?
Points: 1
mediummultiple choiceC Preprocessor1 points
What will be the output of the following C code? #include void f() { #define sf 100 printf("%d",sf); } int main() { #define sf 99; f(); printf("%d",sf); }
Points: 1
mediummultiple choiceC Preprocessor1 points
In the directive #pragma pack(n), if the value of 'n' is given to be 5, then what happens?
Points: 1
mediummultiple choiceC Preprocessor1 points
What will be the output of the following C code? #include #define hello( n ) a##n int a3; int main() { int x; x=hello(3); if(x!=0) printf("hi"); else printf("good"); }
Points: 1
mediummultiple choiceC Preprocessor1 points
Which directive is used to include the contents of another file in a C program using the C preprocessor?
Points: 1
mediummultiple choiceC Preprocessor1 points
What will be the output of the following C code? #define display(text) printf(#text "@") main() { display(hello.); display(good morning!); }
Points: 1
mediummultiple choiceC Preprocessor1 points
What will be the output of the following C code? #include #define ram 557 int main() { #ifndef ram printf("yes"); #endif printf("no"); }
Points: 1
mediummultiple choiceC Preprocessor1 points
What will be the output of the following C code? #include #define hello( n ) printf( "a" #n "= %d", a##n ) int a3=3; int main() { #ifdef a3 hello(3); #else printf("sorry"); #endif }
Points: 1
Want to track your progress?
A free account saves your quiz results and shows how you are doing over time.