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                      
tip   To Refer this Site to Your Friends   Click 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
what is strcture
                
i++ i ++i answer to this i=5 what is the out put
 Question Submitted By :: B4urhtdm
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is strcture i++ i ++i answer to this i=5 what is the out put
Answer
# 1
The o/p will be as follows:-

                  666

reason:- in c++ in cascading the processing will be from
RHS. hence first "++i" will be executed and gives value 6.
after that "i" is executed as 6 and finally "i++" which will
also give 6.

one thing to notice here is that printing will be as usual
i.e. from left to right. So if the structure was "++i i i++"
then o/p will be 765
 
Is This Answer Correct ?    1 Yes 0 No
Shivendra
 
  Re: what is strcture i++ i ++i answer to this i=5 what is the out put
Answer
# 2
The output is 7
 
Is This Answer Correct ?    0 Yes 0 No
Antony
 
 
 
  Re: what is strcture i++ i ++i answer to this i=5 what is the out put
Answer
# 3
The answer is undefined since you are modifying a built in 
type in sequence without a sequence point in between.
 
Is This Answer Correct ?    0 Yes 0 No
Osama
 
  Re: what is strcture i++ i ++i answer to this i=5 what is the out put
Answer
# 4
my answer is 755........
 
Is This Answer Correct ?    0 Yes 0 No
Diliprajug
[Saven]
 
  Re: what is strcture i++ i ++i answer to this i=5 what is the out put
Answer
# 5
My answer is 
1. 
#include<iostream>
using namespace std;
int main()
{
	int i = 5;
	cout << ++i << i << i++ << endl;
	return 0;
}
ANS:765

2. 
#include<iostream>
using namespace std;
int main()
{
	int i = 5;
	cout << ++i ;
	cout << i ;
	cout << i++ << endl;
        return 0;
}
ANS:666
 
Is This Answer Correct ?    0 Yes 0 No
Bala
 

 
 
 
Other STL Interview Questions
 
  Question Asked @ Answers
 
Waht is inheritance  4
what is a template? BITS2
what's the difference between abstract class and concreate class? what's the meaning of standard template library(STL)?  3
Assume I have a linked list contains all of the alphabets from "A" to "Z?" I want to find the letter "Q" in the list, how does you perform the search to find the "Q?"  2
How the STL's are implemented, What the difference between templates and STL? Symphony1
what is strcture i++ i ++i answer to this i=5 what is the out put  5
What is 2*2?  3
What is Template Specialization? Lucent1
What is the underlying datastructure of map? Siemens4
what is an algorithm in terms of STL? Wipro1
In what cases using of a 'template' is a better approach then using of a 'base class'? Lucent6
I am doing my BS.c MATHS CAN I ABLE TO JOIN IN NIIT?  1
write a piece of c++ code which allocate memory to the 50 object of type CObj  2
what's the difference between function overloading and function overiding?  2
What is Object Oriental Progam  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-Microsystems4
c# support late binding or early binding.  3
Explain how to insert a hyperlink in to an Excel worksheet and save a Word document as a Web page.  1
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
 
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