#include<stdio.h>
# define a 10
void main()
{
printf("%d..", a);
foo();
printf("%d", a);
}
void foo()
{
#undef a
#define a 50
}Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
93
Questions
3/5
Page
Pick an option on a question to see the right answer and solution.
#include<stdio.h>
# define a 10
void main()
{
printf("%d..", a);
foo();
printf("%d", a);
}
void foo()
{
#undef a
#define a 50
}Select an option to see the answer and solution.
#define f(g,g2) g##g2
void main()
{
int var12=100;
printf("%d", f(var,12));
}Select an option to see the answer and solution.
#define INC(X) X++
void main()
{
int x=4;
printf("%d", INC(x++));
}Select an option to see the answer and solution.
#include<stdio.h>
#define max 20
main()
{
#ifndef max
#define min 10
#else
#define min 30
#endif
printf("%d",min);
}Select an option to see the answer and solution.
#define display(text) "$" #text
main()
{
printf(display(hello world));
}Select an option to see the answer and solution.
#include <stdio.h>
#define Shyam(x) #x
int main()
{
int marks=100;
printf("value of %s is = %d\n",Shyam(marks),marks);
return 0;
}Select an option to see the answer and solution.
#include<stdio.h>
#define max 100
void main()
{
#if(max%10)
printf("Exam");
#endif
printf("Veda");
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include<stdio.h>
#define INDIA 1
#define US 2
#define CC US
main()
{
#if CC==INDIA
printf("Rupee");
#elif CC==US
printf("Dollar");
#else
printf("Euro");
#endif
}Select an option to see the answer and solution.
#include<stdio.h>
#pragma(1)
struct test
{
int i;
char j;
};
main()
{
printf("%d",sizeof(struct test));
}Select an option to see the answer and solution.
#include <stdio.h>
#define p( m ) printf( "t*" #m " = %s", t##m )
char tram[]="tram";
int main()
{
int x;
x=p(ram);
}Select an option to see the answer and solution.
#include<stdio.h>
#define sf 10
main()
{
if(sf==100)
printf("good");
else
{
printf("bad");
sf=100;
}
printf("%d",sf);
}Select an option to see the answer and solution.
#include<stdio.h>
void main()
{
#ifndef max
printf("hello");
#endif
printf("hi");
}Select an option to see the answer and solution.
#include <stdio.h>
#define world( n ) printf( "t^^" #n" = %c", t##n )
int t3=1;
int main()
{
world(3);
}Select an option to see the answer and solution.
#define F abc
#define B def
#define FB(arg) #arg
#define FB1(arg) FB(arg)
main()
{
printf(FB(F B));
FB1(F B);
}Select an option to see the answer and solution.
#include <stdio.h>
#define p( n,m ) printf( "%d", m##n )
int main()
{
p(3,4);
}Select an option to see the answer and solution.
#define example(s,n) #s #n
main()
{
printf(example(hello,world));
}Select an option to see the answer and solution.
#include <stdio.h>
#define hello( n ) a##n
int a3;
int main()
{
int x;
x=hello(3);
if(x!=0)
printf("hi");
else
printf("good");
}Select an option to see the answer and solution.
#include<stdio.h>
#define hello
main()
{
#ifdef hello
#define hi 4
#else
#define hi 5
#endif
printf("%d",hi);
}Select an option to see the answer and solution.