#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

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

1692


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.

1368


What is a standard template library (stl)? What are the various types of stl containers?

661


What is a list in c++ stl?

684


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

1875






What two types of containers does the stl provide?

564


Is stl open source?

623


Is stl part of c++ standard?

636


What is a stl vector?

621


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

1849


Name the different types of stl containers.

685


Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister

1654


When did c++ add stl?

721


how to use C++?

2059


What does stl stand for in basketball?

632