Standard Template Library (STL) Question:
Download Job Interview Questions and Answers PDF
#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:
Answer #127 4 is the output.
the call to the macro sets a = b*b*b with b = 3, 3 cubed is 27
then b is incremented to 4 after the macro call
the call to the macro sets a = b*b*b with b = 3, 3 cubed is 27
then b is incremented to 4 after the macro call
Answer #260 6
Download Standard Template Library (STL) Interview Questions And Answers
PDF