#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

Is stl part of c++ standard?

0 Answers  


what is compiler?

4 Answers   NASA,


What is the name of your birth place?

0 Answers  


What do stl stand for?

0 Answers  


What is a list in c++ stl?

0 Answers  






What is C++ could you enplane me please?

1 Answers  


What is a standard template library (stl)?

0 Answers  


what is an algorithm in terms of STL?

1 Answers   Lucent, Wipro,


write a piece of c++ code which allocate memory to the 50 object of type CObj

2 Answers  


How stl is different from the c++ standard library?

0 Answers  


write a program to convert a decimal number in to its equivalent binary number?

0 Answers  


Find the error in the following program struct point {struct point *next; int data; } x; main() {int...data; } x; main() {int i; for(x=p;x!=0;) x=x->next,x++; freelist(x); } freelist(x) {free(x); return }

1 Answers   Sun Microsystems,


Categories