adplus-dvertising

Welcome to the Macro and Preprocessor MCQs Page

Dive deep into the fascinating world of Macro and Preprocessor with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Macro and Preprocessor, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Macro and Preprocessor, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Macro and Preprocessor. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Macro and Preprocessor. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Macro and Preprocessor MCQs | Page 1 of 8

Explore more Topics under C Programming

Q1.
What is the output of this program?
#include <stdio.h>
#define int char
main()
{
  int i=50;
  printf ("sizeof (i) =%d", sizeof (i));
}

a.

2

b.

4

c.

8

d.

1

Discuss
Answer: (d).1
Q2.
What is the output of this program?
#include <stdio.h> 
#define x 3
int main()
{
  int i;
  i = x*x*x;
  printf("%d",i);
  return 0;
}
Discuss
Answer: (a).27
Q3.
What is the output of this program?
#include <stdio.h> 
#include  <stdlib.h>
#define square(x) x*x
int main()
{
  int i;
  i = 27/square(3);
  printf("%d",i);
  return 0;
}
Discuss
Answer: (d).27
Q4.
What is the output of this program?
#include <stdio.h>
#define i 5
int main()
{
  #define i 10
  printf("%d",i);
  return 0;
}
Discuss
Answer: (b).10
Q5.
What is the output of this program?
#include <stdio.h>
#define clrscr() 17
int main()
{
  clrscr();
  printf("%d",clrscr());
  return 0;
}
Discuss
Answer: (c).17
Q6.
What is the output of this program?
#include <stdio.h>
int main()
{
  printf("%d",30);
  return 0;
}
Discuss
Answer: (c).Compilation error
Q7.
What is the output of this program?
#include <stdio.h>
#define p 17;
int main()
{
  printf("%d",p);
  return 0;
}
Discuss
Answer: (d).Compilation error
Q8.
What is the output of this program?
#include <stdio.h>
enum colors {comp,sci,edu};
int main()
{
  printf("%d %d %d",edu,comp,sci);
  return 0;
}
Discuss
Answer: (c).2 0 1
Q9.
What is the Error of this program?
#include <stdio.h>
#define CONDITION(x) 
printf("compsciedu");                         
int main()
{
  CONDITION(0);
  return 0;
}
Discuss
Answer: (b).Compilation error
Q10.
What is the output of this program?
#include <stdio.h>
#define CONDITION(x)
printf("compsciedu");                         
int main()
{
  CONDITION(0);
  return 0;
}
Discuss
Answer: (b).compsciedu
Page 1 of 8

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!