Vidyalelo
C Programming · all questions

C Preprocessor
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

93

Questions

5/5

Page

Pick an option on a question to see the right answer and solution.

The pragma . . . . . . . . is used to remove an identifier completely from a program.

Select an option to see the answer and solution.

What will be the output of the following C code if the value of 'p' is 10 and that of 'q' is 15?
#include<stdio.h>
int main()
{
    int p,q;
    printf("Enter two numbers\n");
    scanf("%d",&p);
    scanf("%d",&q);
    #if(4<2)
    printf("%d",p);
    #elif(2>-1)
    printf("%d",q);
    #else
    printf("bye");
    #endif
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define p( n ) printf( "t" #n " = %d", t##n )
int t3=10;
int main()
{
   p(3);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#define hello(c) #c
main()
{
    printf(hello(i,am));
}

Select an option to see the answer and solution.

Which of the following attributes is used to specify that the minimum required memory to be used to represent the types?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include<stdio.h>
#define ram 557
int main()
{
    #ifndef ram
    printf("yes");
    #endif
    printf("no");
}

Select an option to see the answer and solution.

The correct syntax of the attribute packed is . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following C code?
#define hello(c,d) #c #d
main()
{
    printf(hello(i,"am"));
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#define display(a) #a
main()
{
    printf(display("56#7"));
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include<stdio.h>
#pragma GCC poison printf
main()
{
    printf("example");
    return 0;
}

Select an option to see the answer and solution.

Which of the following is a stringizing operator?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define hello( n ) printf( "a" #n "= %d", a##n )
int a3=3;
int main()
{
    #ifdef a3
       hello(3);
   #else
       printf("sorry");
   #endif
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#define sqr(x) x*x
main()
{
    int a1;
    a1=25/sqr(5);
    printf("%d",a1);
}

Select an option to see the answer and solution.