Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What will be the output of
x++ + ++x?

Answers were Sorted based on User's Feedback



What will be the output of x++ + ++x?..

Answer / naveenkumari

here we can see two types of increments pre and post
increment . since x++ is post increment first the value is
assigned and then increments but in case of ++x first the
value is incremented and then assigned since x is not
initialized with any value the above expression gives a
garbage value .For example if x is initialized with a value
"1" then the this expression gives the output as "3"

Is This Answer Correct ?    4 Yes 4 No

What will be the output of x++ + ++x?..

Answer / sujan

let x=1,here it starts with x++, so first x takes value 1 and then it increments to 2.. later ++x.. here x is incremented first i.e.,x=3 and then added to previous value..ie., 1+3
o/p is 4

Is This Answer Correct ?    1 Yes 1 No

What will be the output of x++ + ++x?..

Answer / sairoong.l@drsomchai.net

Test Sairoong

Is This Answer Correct ?    0 Yes 0 No

What will be the output of x++ + ++x?..

Answer / sairoong.l@drsomchai.net

static void Job13(Args _args)
{
Dialog dlg;
DialogField dlgField;
;


dlg = new Dialog("test");
dlg.addGroup("test");
dlgField = dlg.addField(TypeId(CustAccount), "test");

if(dlg.run())
info(dlgField.value());


}

Is This Answer Correct ?    0 Yes 0 No

What will be the output of x++ + ++x?..

Answer / santhi perumal

Answer is 2x+2. For Ex: if x is 2 result is 2(2)+2 = 6.

Is This Answer Correct ?    7 Yes 8 No

What will be the output of x++ + ++x?..

Answer / vaibhav

if x=4 then o/p will be 9

Is This Answer Correct ?    2 Yes 3 No

What will be the output of x++ + ++x?..

Answer / srinivas

for this what is the input value of x.First of all we have
to give the input value of x.
if x = 1 then answer would be
main();
int x=1,y.
y = x++ + ++x.
printf /n'%d',y.
here y = 3

Is This Answer Correct ?    11 Yes 15 No

What will be the output of x++ + ++x?..

Answer / pardeep

answer illl always be 4
value of x ill be 2+2
it willincrement only in 2nd case th ++x

Is This Answer Correct ?    4 Yes 13 No

What will be the output of x++ + ++x?..

Answer / mortal

x++ starts with x and ++x starts with x+1,hence if x=1 then
ans. is 3.

Is This Answer Correct ?    5 Yes 15 No

What will be the output of x++ + ++x?..

Answer / vaibhav

suppse if x=5,
then o/p will be 13

Is This Answer Correct ?    4 Yes 16 No

Post New Answer

More C Interview Questions

What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

0 Answers   Aspire, Infogain,


Whether there can be main inside another main?If so how does it work?

14 Answers   Sail, Wipro,


Concat two string with most overlapped substring has to removeĀ  "abcd"+ "cdef" = "abcdef

6 Answers  


How can I write functions that take a variable number of arguments?

0 Answers  


What are dangling pointers?

1 Answers  


What is a function simple definition?

0 Answers  


#include <stdio.h> int main() { if ("X" <"x") printf("X smaller than x "); } my question is whats the mistake in this program? find it and please tell me..

3 Answers  


What is a structure member in c?

0 Answers  


What is the code in while loop that returns the output of given code?

0 Answers  


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

0 Answers  


Explain how can I manipulate strings of multibyte characters?

0 Answers  


Why data types in all programming languages have some range? Why ritche have disigned first time likethat?Why not a single data type can support all other types?

2 Answers   Excel,


Categories