Which file is generated after pre-processing of a C program?
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
#define CUBE(x) (x*x*x)
int main()
{
int a, b=3;
a = CUBE(b++);
printf("%d, %d\n", a, b);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What is the output of the following C program?
#include
#define SQR(x) (x*x)
int main()
{
int a;
int b=4;
a=SQR(b+2);
printf("%dn",a);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
A macro must always be written in capital letters.
Answer: B
No answer description available for this question.
Enter details here
It is necessary that a header files should have a .h extension?
Answer: B
No, the header files have any kind of extension.
Enter details here
What will be the output of the following C code?
#include
#define max 20
main()
{
#ifndef max
#define min 10
#else
#define min 30
#endif
printf("%d",min);
}
Answer: C
The output of the code shown above is 30. Since the identifier max is defined (the condition of #ifndef is true), hence another identifier, that is, min is defined and its value is equal to 30.
Enter details here
What is the output of this program?
#include
#define int char
main()
{
int i=50;
printf ("sizeof (i) =%d", sizeof (i));
}
Answer: D
No answer description available for this question.
Enter details here
How will you free the memory allocated by the following program?
#include
#define CONDITION(x)
printf("letsfindcourse");
int main()
{
CONDITION(0);
return 0;
}
Answer: B
#define CONDITION(x) ends with backslash(/). So that next line following #define CONDITION(x) will be consider by the C compiler and prints letsfindcourse.
Enter details here
If #include is used with file name in angular brackets.
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
#define SWAP(a, b) int t; t=a, a=b, b=t;
int main()
{
int a=10, b=12;
SWAP(a, b);
printf("a = %d, b = %d\n", a, b);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here