Standard Template Library (STL) Question:
Download Questions 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 #1
27 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

Answer #2
60 6

Download Standard Template Library (STL) Interview Questions And Answers PDF

Previous QuestionNext Question
Write a c++ program to create an object of a class called employee containing the employee code name designation basic salarry HRA Da gross salary as data 10 such objects "members process "?Why & sign is used in copy constructor?