Question
#include <stdio.h>
void f();
int main()
{
#define foo(x, y) x / y + x
f();
}
void f()
{
printf("%d\n", foo(-3, 3));
}
a.
-8
b.
-4
c.
Compile time error
d.
Undefined behaviour
Posted under C Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this C code? #include <stdio.h> void f(); int main() { #define foo(x, y) x / y + x f(); } void f() {...
Similar Questions
Discover Related MCQs
Q. What is the advantage of #define over const?
View solution
Q. Which of the following properties of #define not true?
View solution
Q. The “else if” in conditional inclusion is written by?
View solution
Q. Which of the following sequences are unaccepted in C language?
a) #if
#else
#endif
b) #if
#elif
#endif
c) #if
#if
#endif
d) #if
#undef
#endif
View solution
Q. In a conditional inclusion, if the condition that comes after the if holds.
View solution
Q. Conditional inclusion can be used for
View solution
Q. The #elif directive cannot appear after the preprocessor #else directive
View solution
Q. For each #if, #ifdef, and #ifndef directive
View solution
Q. The #else directive is used for
View solution
Q. Use of functions
View solution
Q. Any C program
View solution
Q. What is function?
View solution
Q. The default parameter passing mechanism is
View solution
Q. Pick the correct statements.
I. The body of a function should have only one return statement.
II. The body of a function may have many return statements.
III. A function can return only one value to the calling environment.
IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.
View solution
Q. Which of the following is a complete function?
View solution
Q. The recursive functions are executed in a ...........
View solution
Q. The function scanf() returns .........
View solution
Q. Functions have ..........
View solution
Q. Which of the following function calculates the square of 'x' in C?
View solution
Q. When a function is recursively called all the automatic variables are stored in a ..........
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Software Engineering
Learn about the systematic approach to developing software with our Software...
Java Programming
Level up your coding skills with our Java Programming MCQs. From object-oriented...