ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  STL
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
#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?
 Question Submitted By :: B.sudharsan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: #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
# 1
surely 'a' cannot be 4 or 6.... it will be the value of b... since we are multiplying b++ thrice...... so surely 'a' cannot be 4 or 6.....

according to me  b=6 , and a=60......


thank u
 
Is This Answer Correct ?    0 Yes 1 No
Vignesh1988i
 
  Re: #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
# 2
27 4 is the output.
 
the call to the macro sets a = b*b*b with b = 3, 3 cubed is 27
then b is incremented to 4 after the macro call
 
Is This Answer Correct ?    3 Yes 0 No
P. Smith
 
 
 

 
 
 
Other STL Interview Questions
 
  Question Asked @ Answers
 
Difference between Structure and Class in C++? Caritor3
Write a program in C/C++ to implement reader- writer problem  1
Give the output of the following program main() {int ret; ret=fork();ret=fork();ret=fork();ret=fork(); if(!ret) printf("sun"); else printf("solaris"); Sun-Microsystems8
What is Constructor Angel-Broking4
what's the difference between function overloading and function overiding?  3
how to overload << and >> operator in c++ Wipro3
Write a program in C++ returning starting locations of a substring using pointers  1
what is electronic software  1
what is strcture i++ i ++i answer to this i=5 what is the out put  5
Write a program in C++ to concatenate two strings into third string using pointers  2
Explain how to insert a hyperlink in to an Excel worksheet and save a Word document as a Web page.  1
c# support late binding or early binding.  3
what is use of for loop? Wipro9
WHAT IS FIBONACCI SERIES? Stewart4
Diffrernce Between Overloading and Overriding? Wipro2
write a program that input four digit number and find how many 7 that number contains  4
Define the terms: field, record, table and database  1
if 4-5 year old brother is standing on d roof with me and watching d moon, suddenly moon coverd by cloud then how will i explain d hiding of moon to my brother. MBT7
How the STL's are implemented, What the difference between templates and STL? Symphony1
In what cases using of a 'template' is a better approach then using of a 'base class'? Lucent6
 
For more STL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com