what is strcture

i++ i ++i answer to this i=5 what is the out put

Answers were Sorted based on User's Feedback



what is strcture i++ i ++i answer to this i=5 what is the out put..

Answer / bala

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 ?    4 Yes 0 No

what is strcture i++ i ++i answer to this i=5 what is the out put..

Answer / shivendra

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 ?    5 Yes 2 No

what is strcture i++ i ++i answer to this i=5 what is the out put..

Answer / subbu

566

Is This Answer Correct ?    1 Yes 1 No

what is strcture i++ i ++i answer to this i=5 what is the out put..

Answer / osama

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 1 No

what is strcture i++ i ++i answer to this i=5 what is the out put..

Answer / diliprajug

my answer is 755........

Is This Answer Correct ?    0 Yes 1 No

what is strcture i++ i ++i answer to this i=5 what is the out put..

Answer / antony

The output is 7

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More STL Interview Questions

In what scenario does the Logical file and Physical file being used?

0 Answers   informatics,


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

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

0 Answers  


How do you convert stl to steps?

0 Answers  


Define stl.

0 Answers  






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

0 Answers   NDS,


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

0 Answers  


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.

0 Answers  


Give the output of the following program main() {char *p='a'; int *i=100/*p; } what will be the value of *i= 1

6 Answers   Sun Microsystems,


What does stl stand for in basketball?

0 Answers  


why we are using the fork command?.. how it works?

1 Answers  


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

0 Answers  


Categories