Would the following typedef work?
typedef #include l;
Answer: B
Because typedef goes to work after preprocessing.
Enter details here
What will be the output of the program?
#include
#define MIN(x, y) (x 0)
printf("%d\n", z);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Output of following C program?
#include
#define max abc
#define abc 100
int main()
{
printf("maximum is %d", max);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
The EOF character can be included in a file as part of its data
Answer: B
No, The EOF character can not be included in a file as part of its data.
Enter details here
What will be the output of the program?
#include
#define PRINT(int) printf("int=%d, ", int);
int main()
{
int x=2, y=3, z=4;
PRINT(x);
PRINT(y);
PRINT(z);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Will it result in to an error if a header file is included twice?
Answer: C
Unless the header file has taken care to ensure that if already included it doesn't get included again.
Turbo C, GCC compilers would take care of these problems, generate no error.
Enter details here
Macros with arguments are not allowed.
Answer: B
No answer description available for this question.
Enter details here
A macro should always be accommodated in a single line.
Answer: A
Usually true. Some compilers allow multi-line macros
Enter details here
What will be the output of the program?
#include
#define SQR(x)(x*x)
int main()
{
int a, b=3;
a = SQR(b+2);
printf("%d\n", a);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
#include
#define a 10
int main()
{
printf("%d ",a);
#define a 50
printf("%d ",a);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here