# 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

where do we use volatile keyword?

1 Answers  


What is the scope of static variables in c language?

0 Answers  


Which of the following about automatic variables within a function is correct ? a.its type must be declared before using the variable b.they are local c.they are not initialised to zero d.they are global.

6 Answers   FCI, TCS,


What are header files in c?

0 Answers  


write a program to print calender using for loop.

1 Answers   HCL, TCS,






Will Macros support multiple arguments ?

7 Answers   Oracle,


what is data structure.in linear and non linear data structures which one is better?Explain

3 Answers   Wipro,


Why string is used in c?

0 Answers  


Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.

2 Answers  


what is use of loop?

10 Answers   Infosys,


Explain what is output redirection?

0 Answers  


What do you mean by a sequential access file?

0 Answers  


Categories