Top

C Preprocessor

61.

Which file is generated after pre-processing of a C program?

Answer: B

No answer description available for this question.

Enter details here

62.

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

63.

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

64.

A macro must always be written in capital letters.

Answer: B

No answer description available for this question.

Enter details here

65.

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

66.

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

67.

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

68.

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

Answer: A

No answer description available for this question.

Enter details here

70.

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

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