main()

{

int i=-1;

+i;

printf("i = %d, +i = %d \n",i,+i);

}



main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }..

Answer / susie

Answer :

i = -1, +i = -1

Explanation:

Unary + is the only dummy operator in C. Where-ever it
comes you can just ignore it just because it has no effect
in the expressions (hence the name dummy operator).

Is This Answer Correct ?    20 Yes 1 No

Post New Answer

More C Code Interview Questions

char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  


#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }

1 Answers  


write a simple calculator c program to perform addition, subtraction, mul and div.

0 Answers   United Healthcare, Virtusa,


What is your nationality?

1 Answers   GoDB Tech,


main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

2 Answers  






main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }

2 Answers  


how can i cast a char type array to an int type array

2 Answers  


what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 Answers  


main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000

3 Answers   HCL,


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


main() { int i=5; printf("%d",++i++); }

1 Answers  


Categories