Log In Register

Units


Conditional Inclusion - Questions and Answers

 

Practice these Conditional Inclusion under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Conditional Inclusion for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Conditional Inclusion of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Conditional Inclusion.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Conditional Inclusion under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Conditional Inclusion topic of C Programming:

 

1.

The #else directive is used for

Answer: Option D

Explanation:

2.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define SYSTEM 20
  3.     int main()
  4.     {
  5.         int a = 20;
  6.         #if SYSTEM == a
  7.         printf("HELLO ");
  8.         #endif
  9.         #if SYSTEM == 20
  10.         printf("WORLD\n");
  11.         #endif
  12.     }

Answer: Option C

Explanation:

3.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define MIN 0
  3.     #if MIN
  4.     #define MAX 10
  5.     #endif
  6.     int main()
  7.     {
  8.         printf("%d %d\n", MAX, MIN);
  9.         return 0;
  10.     }

Answer: Option C

Explanation:

4.

The “else if” in conditional inclusion is written by?

Answer: Option A

Explanation:

5.

The #elif directive cannot appear after the preprocessor #else directive.

Answer: Option D

Explanation:

6.

What is the output of code given below?

  1.     #include <stdio.h>
  2.     #define MIN 0);
  3.     #ifdef MIN
  4.     #define MAX 10
  5.     #endif
  6.     int main()
  7.     {
  8.         printf("%d %d\n", MAX, MIN
  9.         return 0;
  10.     }

Answer: Option D

Explanation:

7.

Conditional inclusion can be used for

Answer: Option D

Explanation:

8.

For each #if, #ifdef, and #ifndef directive.

Answer: Option D

Explanation:

9.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define MIN 0
  3.     #ifdef MIN
  4.     #define MAX 10
  5.     #endif
  6.     int main()
  7.     {
  8.         printf("%d %d\n", MAX, MIN);
  9.         return 0;
  10.     }

Answer: Option D

Explanation:

10.

Comment on the following code?

  1.     #include <stdio.h>
  2.     #define Cprog
  3.     int main()
  4.     {
  5.         int a = 2;
  6.         #ifdef Cprog
  7.         a = 1;
  8.         printf("%d", Cprog);
  9.     }

Answer: Option A

Explanation:

11.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define MIN 0
  3.     #ifdef(MIN)
  4.     #define MAX 10
  5.     #endif
  6.     int main()
  7.     {
  8.         printf("%d %d\n", MAX, MIN);
  9.         return 0;
  10.     }

Answer: Option A

Explanation:

12.

Which of the following sequences are unaccepted in C language?

Answer: Option B

Explanation:

13.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define COLD
  3.     int main()
  4.     {
  5.         #ifdef COLD
  6.         printf("COLD\t");
  7.         #undef COLD
  8.         #endif
  9.         #ifdef COLD
  10.         printf("HOT\t");
  11.         #endif
  12.     }

Answer: Option C

Explanation:

14.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define MIN 0
  3.     #if defined(MIN) - (!defined(MAX))
  4.     #define MAX 10
  5.     #endif
  6.     int main()
  7.     {
  8.         printf("%d %d\n", MAX, MIN);
  9.         return 0;
  10.     }

Answer: Option D

Explanation:

15.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #define MIN 0
  3.     #if defined(MIN) + defined(MAX)
  4.     #define MAX 10
  5.     #endif
  6.     int main()
  7.     {
  8.         printf("%d %d\n", MAX, MIN);
  9.         return 0;
  10.     }

Answer: Option C

Explanation: