Top

C Preprocessor

Answer: A

No answer description available for this question.

Enter details here

112.

Predict the output of following program?

#include 
#define MAX 1000
int main()
{
   int MAX = 100;
   printf("%d ", MAX);
   return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

113.

Which of the following are correctly formed #define statements?

Answer: D

No answer description available for this question.

Enter details here

114.

#include 
#define get(s) #s
 
int main()
{
    char str[] = get(GeeksQuiz);
    printf("%s", str);
    return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

115.

Nested macros are allowed.

Answer: B

No answer description available for this question.

Enter details here

116.

Which statment is true about the given code ?

#include 
enum colors {lets,find,course};
int main()
{
  printf("%d %d %d",course,lets,find);
  return 0;
}

 

Answer: C

enum assigns numbers starting from 0, if not explicitly defined by some other integer.

Enter details here

117.

Will the program compile successfully?

#include

int main()
{
    printf("India" "BIX\n");
    return 0;
}

 

Answer: A

Yes, It prints "IndiaBIX"

Enter details here

118.

The preprocessor directive which checks whether a constant expression results in a zero or non-zero value __________

Answer: A

#if checks whether a constant expression results in zero or not. If the expression is a non-zero value, then the statements between #if and #endif will be executed. If the constant expression results in a zero value, the statements between #if and #endif will not be executed.

Enter details here

119.

What is the Error of this program?

#include 
#define CONDITION(x) 
printf("letsfindcourse");                         
int main()
{
  CONDITION(0);
  return 0;
}

 

Answer: B

#define CONDITION(x) must be terminated my backslash () to follow the next line.

Enter details here

Loading…
Tags: C Preprocessor Questions and Answers || C Preprocessor MCQ Questions and Answers || C Preprocessor GK Questions and Answers || C Preprocessor GK MCQ Questions || C Preprocessor Multiple Choice Questions and Answers || C Preprocessor GK || GK on C Preprocessor || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming