#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 / pratap keshari

The output will be 27 6

b++ will be replaced as 3++ in the macro and these values
will be evaluated after the macro execution.Hence first it
will evaluate to 3's cube and then increment 3 three times

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how can u do connectivity in c++ language? plz send me connectivity code in c++ ?

1895


What are the different types of stl containers?

652


Is string part of stl?

681


Can we use stl in coding interviews?

1282


Define stl.

778






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

1777


how to use C++?

2067


What is the use of stl?

638


What does stl stand for in basketball?

643


What are the various types of stl containers?

733


Why should a c++ programmer be interested in stl?

646


How does an stl file work?

654


Is there any error below, its a code to delete all entires from a map #include #include iostream.h int main() { int i =0; map TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }

1894


What is meant by stl in c++?

657


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

1702