#define CUBE(x) (x*x*x)
main()
{ int a,b=3;
a=cube(b++);
printf("%d %d",a,b);
}
What should be the value of a and b? My calc a=4 but syst
a=6 how pls tell me if you know it?

Answers were Sorted based on User's Feedback



#define CUBE(x) (x*x*x) main() { int a,b=3; a=cube(b++); printf("%d %d",a,b); } Wh..

Answer / vignesh1988i

surely 'a' cannot be 4 or 6.... it will be the value of b... since we are multiplying b++ thrice...... so surely 'a' cannot be 4 or 6.....

according to me b=6 , and a=60......


thank u

Is This Answer Correct ?    4 Yes 9 No

#define CUBE(x) (x*x*x) main() { int a,b=3; a=cube(b++); printf("%d %d",a,b); } Wh..

Answer / jesaul

The code will not compile. The macro is in wrong case.
After fixing that you would get 27 6

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More STL Interview Questions

what is c++

2 Answers  


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

0 Answers   NDS,


what is an algorithm in terms of STL?

1 Answers   Lucent, Wipro,


what is the difference between thread and process

1 Answers   Infosys,


why & sign is used in copy constructor

4 Answers  






How do you convert stl to steps?

0 Answers  


what is the acronym of the term 'C.O.M.P.U.T.E.R' ?

17 Answers   Config Systems, Google, Wipro,


what are you now programming Languages C+

1 Answers   HCL,


Define the terms: field, record, table and database

5 Answers  


What is stl in oop?

0 Answers  


Can we use stl in coding interviews?

0 Answers  


What are the various types of stl containers?

0 Answers  


Categories