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

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

2 Answers  


main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above

4 Answers   HCL, LG,


# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }

1 Answers  


Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 Answers  


Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,






#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

1 Answers  


What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }

1 Answers  


write a origram swaoing valu without 3rd variable

2 Answers  


how to swap 3 nos without using temporary variable

4 Answers   Satyam,


PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


Categories