Recent questions tagged macros

488
views
1 answers
4 votes
#include<stdio.h> #include<string.h> #define MAX(x, y) ((x) > (y) ? (x) : (y)) int main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i, j, k); return 0; }
369
views
0 answers
0 votes
Assembler,Linker,Macros are there in compiler design?
382
views
1 answers
0 votes
Float pi = 3.14#define pi 3.14Why constant declaration with define is considered to be fast than above one?Thanks
3.4k
views
2 answers
5 votes
In multi-programmed systems, it is advantageous if some programs such as editors anf compilers can be shared by several users.Which of the following must ... program is recursive The program is reentrantI onlyII onlyIII onlyI, II and III
994
views
1 answers
5 votes
#include <stdio.h> #define A -B #define B -C #define C 5 int main(void) { printf("%d",A); return 0; }now my doubt here is, before compilaion i ... error and giving answer as 5, but macro implicitly never put precedence braces() itself...
3.4k
views
1 answers
2 votes
Use of macro instead of function is recommended.(a) when one wants to reduce the execution time(b) when there is a loop with a function call inside(c) when a function is ... ) In (a) and (b) aboveCan some one explain how option 'b' is true?
763
views
1 answers
1 votes
Consider the definition of macro $B,$ nested within the definition of a macro $A.$ Can a call to macro $B$ also appear within macro $A?$ If not, why not? If yes, explain if there are any restrictions.
1.2k
views
1 answers
0 votes
Match each software term in List-I to its description in List-II : ... iii, c-v, d-i, e-ii}$\text{a-iv, b-iii, c-ii, d-v, e-i}$
2.2k
views
1 answers
1 votes
'Macro' in an assembly level program is _______.Sub programA complete programA hardware portionRelative coding
2.0k
views
2 answers
1 votes
Please explain the solution.The output is 11 7 0#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k == MAX(i++, ++j); printf("%d %d %d", i,j,k); }What will the values of i , j and k?
8.4k
views
9 answers
7 votes
What is the output of the following C program? #include<stdio.h> #define SQR(x) (x*x) int main() { int a; int b=4; a=SQR(b+2); printf("%d\n",a); return 0; }14361820
724
views
1 answers
1 votes
#include <stdio.h> #define crypt(s,t,u,m,p,e,d) m##s##u##t #define begin crypt(a,n,i,m,a,t,e) int begin() { printf("Hello\n"); return 0; }Options are :(a) Hello (b) Link error (c) Segmentation fault (d) Compiler error
494
views
2 answers
1 votes
Consider the following program:# define Rec(a) a + a * aint a;a = 20 + Rec(a) * Rec(a + 1);printf(“%d”, a)return 0;}The output of above program for a = 3 is ________.
6.3k
views
2 answers
8 votes
Consider the following statements#define hypotenuse (a, b) sqrt (a*a+b*b);The macro call hypotenuse(a+2,b+3);Finds the hypotenuse of a triangle with sides $a+2$ and $b+3$ ... $(b+3)^2$Is invalidFind the square root of $3 *a+4*b+5$
3.9k
views
2 answers
8 votes
Which of the following macros can put a macro assembler into an infinite loop?.MACRO M1, X .IF EQ, X ;if X=0 then M1 X + 1 .ENDC .IF NE, X ;if X ≠ O then .WORD ... X .WORD X + 1 .ENDC .ENDM(ii) only(i) onlyboth (i) and (ii)None of the above
4.8k
views
3 answers
15 votes
What are $x$ and $y$ in the following macro definition?macro Add x, y Load y Mul x Store y end macroVariablesIdentifiersActual parametersFormal parameters
5.3k
views
2 answers
16 votes
The conditional expansion facility of macro processor is provided totest a condition during the execution of the expanded programto expand certain model statements ... upon the value of a condition during the process of macro expansion
1.6k
views
3 answers
7 votes
Macro expansion is done in pass one instead of pass two in a two pass macro assembler because _________
To see more, click for the full list of questions or popular tags.