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 |
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
main() { int i = 3; for (;i++=0;) printf(ā%dā,i); }
what is oop?
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
35 Answers Tata Elxsi, TCS, VI eTrans,
how to delete an element in an array
Is the following code legal? struct a { int x; struct a b; }
#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }
Derive expression for converting RGB color parameters to HSV values
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?
How can i find first 5 natural Numbers without using any loop in c language????????