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 |
difference between memcpy and strcpy
What is meant by global static? why we have to use static variable instead of Global variable
main() { int a; a=++100; printf("%d",a); getch(); }
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
What is the output of below code? main() { static in a=5; printf("%3d",a--); if(a) main(); }
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
What is structure in c language?
Tell us the difference between these two : #include"stdio.h" #include<stdio.h> define in detial.
Are there any problems with performing mathematical operations on different variable types?
du u know test pattern for robosoft? Plz share
1 Answers RoboSoft, TATA, Wipro,
program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
write a code for large nos multilication (upto 200 digits)