Top

C Preprocessor

91.

Would the following typedef work?
typedef #include l;

Answer: B

Because typedef goes to work after preprocessing.

Enter details here

92.

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

93.

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

94.

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

95.

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

96.

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

97.

Macros with arguments are not allowed.

Answer: B

No answer description available for this question.

Enter details here

98.

A macro should always be accommodated in a single line.

Answer: A

Usually true. Some compilers allow multi-line macros

Enter details here

99.

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

100.

#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

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