#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


Please Help Members By Posting Answers For Below Questions

help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase

1876


Define stl.

766


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

636


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2085


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

1692






What is the use of stl?

627


Is string part of stl?

668


What is a list in c++ stl?

684


What are the various types of stl containers?

723


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

1771


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

1883


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

634


What is stl language?

666


Is stl open source?

623


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

2070