41. What will be output after executing following code?
#include<stdio.h>
# define a 10
void main()
{
printf("%d..", a);
foo();
printf("%d", a);
}
void foo()
{
#undef a
#define a 50
}
#include<stdio.h>
# define a 10
void main()
{
printf("%d..", a);
foo();
printf("%d", a);
}
void foo()
{
#undef a
#define a 50
}
42. The output of the following program is:
#define f(g,g2) g##g2
void main()
{
int var12=100;
printf("%d", f(var,12));
}
#define f(g,g2) g##g2
void main()
{
int var12=100;
printf("%d", f(var,12));
}
43. Find the output of the following program.
#define INC(X) X++
void main()
{
int x=4;
printf("%d", INC(x++));
}
#define INC(X) X++
void main()
{
int x=4;
printf("%d", INC(x++));
}
44. What will be the output of the following C code?
#include<stdio.h>
#define max 20
main()
{
#ifndef max
#define min 10
#else
#define min 30
#endif
printf("%d",min);
}
#include<stdio.h>
#define max 20
main()
{
#ifndef max
#define min 10
#else
#define min 30
#endif
printf("%d",min);
}
45. What will be the output of the following C code?
#define display(text) "$" #text
main()
{
printf(display(hello world));
}
#define display(text) "$" #text
main()
{
printf(display(hello world));
}
46. What will be the output of the following C code?
#include <stdio.h>
#define Shyam(x) #x
int main()
{
int marks=100;
printf("value of %s is = %d\n",Shyam(marks),marks);
return 0;
}
#include <stdio.h>
#define Shyam(x) #x
int main()
{
int marks=100;
printf("value of %s is = %d\n",Shyam(marks),marks);
return 0;
}
47. What will be the output of the following C code?
#include<stdio.h>
#define max 100
void main()
{
#if(max%10)
printf("Exam");
#endif
printf("Veda");
}
#include<stdio.h>
#define max 100
void main()
{
#if(max%10)
printf("Exam");
#endif
printf("Veda");
}
48. . . . . . . . . is the preprocessor directive which is used to end the scope of #ifdef.
49. In the directive #pragma pack(n), if the value of 'n' is given to be 5, then what happens?
50. What will be the output of the following C code?
#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
}
#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
}