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 program in c to print 1 121 12321 1234321 123454321
11 Answers ANR, College School Exams Tests, Mu Sigma, Wipro,
What are the preprocessor categories?
c pgm count no of lines , blanks, tabs in a para(File concept)
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
how to find binary of number?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
how to implement stack operation using singly linked list
what are the compilation steps? ( i want inside the compiler )
tell me the full form of c?
Write a program to print this triangle: * ** * **** * ****** * ******** * ********** Don't use printf statements;use two nested loops instead. you will have to use braces around the body of the outer loop if it contains multiple statements.
there is two conditions , 1. while using for loop for printing 1 to 50 no's simulteneous 2. while using printf functios for printing 1 to 50 no's simulteneous with or without using variables who will take more time for compiling and execution? explain in details with reason?
Which are low level languages?