# define prod(a,b)=a*b
main()
{
int x=2;
int y=3;
printf("%d",prod(x+2,y-10)); }

the output of the program is
a.8
b.6
c.7
d.none

Answers were Sorted based on User's Feedback



# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / arun raj

It will lead to compilation error..
Note: # define prod(a,b)=a*b
'=' is not allowed with #define

regards,
Arun Raj

Is This Answer Correct ?    19 Yes 1 No

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / mannucse

d

Is This Answer Correct ?    13 Yes 2 No

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / shruti

the syntax for writting the macro is wrong..

we can't have "=" sign while writing macro..
i.e. #define -----

Is This Answer Correct ?    8 Yes 0 No

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / shinu

d

Is This Answer Correct ?    3 Yes 0 No

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / hussain reddy

d

Is This Answer Correct ?    3 Yes 0 No

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / vint

Assuming '=' is added by mistake in the macro.
#define prod(a,b) a*b
int main()
{
int x=2, y=3;
printf("%d",prod(x+2,y-10));
return 0;
}
Ans: None
The output is -2
a*b
x+2*y-10
2+2*3-10
2+6-10
8-10
-2

Is This Answer Correct ?    4 Yes 1 No

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(..

Answer / sivasyam

with out using conditional opraters and conditional
statments(i.e &,| etc, and if,whileand etc.,) find the
bigeesst value between two values

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

How will you declare an array of three function pointers where each function receives two ints and returns a float?

0 Answers   TISL,


#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); }

3 Answers   ADITI,


is c language is a object oreinted language?

5 Answers   TCS,


can u write a program in C, which does not use = (eqaul)or any arithmatic assignment(like -=,+=,*= etc) operator to swap to number?

2 Answers  


How can a program be made to print the name of a source file where an error occurs?

0 Answers  






What is the advantage of a random access file?

0 Answers  


Write a program that receives as input a number omaadel-n-print, four digits.

0 Answers  


What is meant by high-order and low-order bytes?

0 Answers  


how to create duplicate link list using C???

0 Answers  


What is && in c programming?

0 Answers  


can we print any string in c language without using semicolon(;)(terminator) in whole program.

11 Answers  


Write a program to show the change in position of a cursor using c

0 Answers  


Categories