#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?
Answer Posted / prabhaaa
since macro is expanded like (x++ * x++ * x++) = (3 * 4 *
5) ..here the value increments in each of its position. first [3 *3++*(3++)++] = [3*4*4++]
= [3*4*5]
a = 60
and here b increments three times .3++=4, 4++=5 ,5++=6.
final value of b = 5++ => 6
ans : 60, 6
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What are the various types of stl containers?
How connect plc and pc through software
What is a stl vector?
What is the use of stl?
When did c++ add stl?
Is stl part of c++ standard?
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
What is the stl, standard template library?
a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.
How is stl different from c++ standard library?
please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html
What two types of containers does the stl provide?
What is meant by stl in c++?
What is a list in c++ stl?
how to making game in c++ ?