main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / furquan
Here what happens is :
while(+(+i--)!=0)
i = 0
so 0 != 0 is false hence condition for while fails. Now
there is also a post decrement operator. So value of i turns
out to be -1. and that is which is printed.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / rameshp
ans s -1
Bec
while(1!=0) this s false..so next line don't exec..
so i-- means 0--= -1
finally we get -1
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / priyadarshan kasta
-1.
i don't know why.
plz post the reason
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / rayan
ans is -1.
Initially i == 0, when it enters into while loop
while(+(+i--)!0)
in 1st iteration i value ll be 0 only due to post decrement
operator.
in second iteration as i gets its post decremented value n
becomes -1 & -1 ~= 0 condition gets true & while loop breaks.
here + operator in the loop is doing ntg.
| Is This Answer Correct ? | 2 Yes | 1 No |
write a c program to find the square of a 5 digit number and print the result.
5 Answers Accenture, Sasken, Vimukti Technologies,
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
I came across some code that puts a (void) cast before each call to printf. Why?
how to connect oracle in C/C++.
What is the most efficient way to count the number of bits which are set in a value?
How can you tell whether a program was compiled using c versus c++?
Are bit fields portable?
What are directives in c?
Whats s or c mean?
write a program that will print %d in the output screen??
Explain what is dynamic data structure?
main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(ā%dā,x); }