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 ? | 73 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 |
main() { int a[10]; printf("%d",*a+1-*a+3); }
main() { 41printf("%p",main); }8
source code for delete data in array for c
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16
main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above