main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
-1
Explanation:
Unary + is the only dummy operator in C. So it has no effect
on the expression and now the while loop is, while(i--!=0)
which is false and so breaks out of while loop. The value –1
is printed due to the post-decrement operator.
| Is This Answer Correct ? | 75 Yes | 2 No |
Answer / govind verma
output will be -1.... because inwhile +(+i--)!=0 () have higher precedence then control goes to in parenthses and unary plus and ++ have the same precedece in table then we chek the associativty which is right to left i++ is evaluate first then the value of i will not chang withn a same expression because its a post fix increment now expression become +(+0)!=0 and unary plus have no effect then expression look lyk 0!=0 this condition is false then while block of code will not execute and nw i become -1 and we try to print like this printf("%d",-1); then output will -1
| Is This Answer Correct ? | 9 Yes | 2 No |
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
Find the largest number in a binary tree
Develop a routine to reflect an object about an arbitrarily selected plane
Find your day from your DOB?
15 Answers Accenture, Microsoft,
main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
Finding a number multiplication of 8 with out using arithmetic operator
write a c-program to find gcd using recursive functions
why array index always strats wuth zero?