0 of 20 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 20 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
2. Types of macros
3. By using _________ we will define macro
4. Simple macro is ________
5. To un-define a macro_______ we will use
6. Example for nested macro
7.Macro is a Pre-processor directive.
8. C compiler replaces all the occurrence of a macro tag with pre defined value ( or text) that is known as
9 . What will be the output of following code
#include<stdio.h>
#define abc(a,b) (a>b)?a:b;
main()
{
int k,m=10,n=5,p=0;
k=abc(++m, n++);
printf(“%d,%d,%d\n”,m,n,k);
}
10. _______ directive we are going to use whether macro is defined are not
11. What will be the output of following code
#include<stdio.h>
#define abc(a) (a*a)
main()
{
int k,m=4;
k=abc(m+3);
printf(“%d,%d\n”,m,k);
}
12. _______ many types of macros we have
13. Find the output for bellow program?
#include<stdio.h>
#define PRINT(int) printf(“%d”,int)
main()
{
int k,m=4;
PRINT(m);
printf(“ ”);
PRINT(‘A’);
}
14. What will be the output for following code
#include<stdio.h>
#define SMALL(x,y) (x>y)?x:y;
main()
{
int k,m=4;
k=SMALL(4,5);
printf(“%d %d\n”,k,SMALL(2,3));
}
15. Example for Macro with argument.
16. What will be the output of following code?
#include<stdio.h>
#define swap(x,y) int t;t=x,x=y,y=t;
main()
{
int k=9,m=4;
swap(m,k)
printf(“k=%d m=%d\n”,k,m);
}
17. Find the output for following program
#include<stdio.h>
#define ram “Ram”
main()
{
printf(“ram”);
}
18. Applications of macros
19. Advantages of macros
20. Disadvantages of macros