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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
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
 
How Find, Replace and Go To commands ca be used to substitute one character string for another? Explain with the heIp of an example.  1
What is the Difference between CArray and CList? Siemens1
Waht is inheritance  6
tell about sorted linked list  1
Explain how to insert a hyperlink in to an Excel worksheet and save a Word document as a Web page.  1
What is the STL? HP2
what is the acronym of the term 'C.O.M.P.U.T.E.R' ? Google5
what is an algorithm in terms of STL? Wipro1
WHAT IS FIBONACCI SERIES? Stewart4
why does the execution of a c++ program start with main()???  9
c# support late binding or early binding.  3
What is the underlying datastructure of map? Siemens4
how to swap two numbers in a linked list without exchanging the data but only the links? Wipro2
Which data structure gives efficient search? A. B-tree B. binary tree C. array D. linked list Sun-Microsystems19
Give the output of the following program main() {char *p='a'; int *i=100/*p; } what will be the value of *i= 1 Sun-Microsystems4
Write a program in C++ to concatenate two strings into third string using pointers  2
Write a program in C/C++ to implement reader- writer problem  1
what is electronic software  1
I am doing my BS.c MATHS CAN I ABLE TO JOIN IN NIIT?  2
why we are using the fork command?.. how it works?  1
 
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