#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 / ashwini

above code have error.If used CUBE instead of cube then
output will be

A = CUBE(B++ * B++ * B++)
as ++ is post increment plus operator so A = 27 and then B
gets incremented three times so B = 6

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stl in c++ with example?

634


Who wrote stl?

678


How do you convert stl to steps?

632


How connect plc and pc through software

1923


What are the different types of stl containers?

652






What is a stl vector?

628


What is stl stack?

665


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

645


how to use C++?

2067


What is stl language?

678


Is stl open source?

634


Define stl.

778


What two types of containers does the stl provide?

573


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


Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.

2311