void main()
{
int i=5;
printf("%d",i+++++i);
}

Answers were Sorted based on User's Feedback



void main() { int i=5; printf("%d",i+++++i); }..

Answer / nagarajan

If it is i++ + ++i the output will be 12 because
i++ =6
++1 =6

6+6=12

but in this case continuous five plus will show error .

compiler cannot identify operands there must be a space in between

Is This Answer Correct ?    55 Yes 21 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / junaid

well if you write all 5+ without space then it will give an error because compiler will not recognize it
you can write i++ + ++i or ++i + i++
answer in both statements will be 12

Is This Answer Correct ?    16 Yes 7 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / m

oly error wil be produced

Is This Answer Correct ?    9 Yes 2 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / harshawardhan

all functions pass the value from right to left and printf()
is one function therefore
i++ + ++i
in this siquence first solve the ++i and then solve the i++
first incrment by one i.e. 6 and then it solve i++ i.e. 5

printf("%d",i++ + ++i);
printf("%d",i++ + 6);
printf("%d",6 + 6);
printf("%d",12);


And therefoe output is:-

12

Is This Answer Correct ?    13 Yes 9 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / sadfasd

hmmm

Is This Answer Correct ?    2 Yes 2 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / gaurav tyagi

first of all
i want to say every one plz write ans if you are fully confident otherwise run it
///in this program a error is occurs because compiler not recognize the code <i am run this one>

Is This Answer Correct ?    3 Yes 3 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / srinivas

printf allways it will work from right to left so first
++i=6 after that i++ also 6 so 6+6=12 ..

Is This Answer Correct ?    9 Yes 10 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / vns

Increment operator(++i) only increases i value. At first ++i, i value becomes 6. Then there's another ++i, now i value is 7. both increment operations are evaluated since it has higher precedence than addition. So (++i) +(++i)= (i)+(i)= 7+7=14.

compile and run the program and you will get 14.

Is This Answer Correct ?    1 Yes 2 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / rohit surutkar

error

Is This Answer Correct ?    2 Yes 4 No

void main() { int i=5; printf("%d",i+++++i); }..

Answer / taruna

plzzz explain this ...why can't its answer be 12..???
plzz give proper explaination....waitin!!!

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More C C++ Errors Interview Questions

which typw of errors ? & how to solve it ?

0 Answers  


what is meant for variable not found?

3 Answers  


what is meant by linking error? how can i solve it? if there is a linking error " unable to open file 'cos.obj'? then what should i do?

1 Answers  


what is exceptions?

5 Answers   HCL, Wipro,


I am using Qt 5.6 during compilation it stops and gives error about Qmake The process "C:QtQt5.6.35.6.3msvc2015_64inqmake.exe" crashed. Error while building/deploying project untitled1 (kit: Desktop Qt 5.6.3 MSVC2015 64bit) When executing step "qmake"

0 Answers  






Declaration of Cube Guys please help me.. Is this a right way to declare cube.? If i Compile it. It Says: Cube undeclared what should i do? Please help \thanks in advanced #include<stdio.h> #include<math.h> #include<conio.h> main( ) { float x,y; while(x++<10.0) { printf("Enter Number:"); scanf("%d", &x); y = cube(x); printf("%f %f %f \n", x,pow(x,2),y); cube(x); } { float x; float y; y = x*x*x; } getch(); return (y); }

2 Answers  


wap for bubble sort

3 Answers  


what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?

2 Answers   TCS,


I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX

0 Answers  


How to convert hexadecimal to binary using c language..

1 Answers   Bajaj, GAIL, Satyam, Zenqa,


what is syntax error?

3 Answers  


Write a c-programe that input one number of four digits and find digits sum?

2 Answers  


Categories