main()

{

printf("%x",-1<<4);

}




Answers were Sorted based on User's Feedback



main() { printf("%x",-1<<4); }..

Answer / susie

Answer :

fff0

Explanation :

-1 is internally represented as all 1's. When
left shifted four times the least significant 4 bits are
filled with 0's.The %x format specifier specifies that the
integer value be printed as a hexadecimal value.

Is This Answer Correct ?    73 Yes 16 No

main() { printf("%x",-1<<4); }..

Answer / sourab

thts ans is ture 4 16 bit compiler ,for 32 bit ans is fffffff0.

Is This Answer Correct ?    28 Yes 7 No

main() { printf("%x",-1<<4); }..

Answer / aruna

-16

Is This Answer Correct ?    3 Yes 11 No



Post New Answer



More C Code Interview Questions

main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

2 Answers   CSS, Wipro,


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

0 Answers   TCS,


int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().

1 Answers  


void main() { char ch; for(ch=0;ch<=127;ch++) printf(ā€œ%c %d \nā€œ, ch, ch); }

1 Answers  






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

3 Answers  


main() { int i = 3; for (;i++=0;) printf(ā€œ%dā€,i); }

1 Answers   CSC,


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

3 Answers  


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

1 Answers  


what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }

3 Answers   Wipro,


Is the following code legal? typedef struct a { int x; aType *b; }aType

1 Answers  


How to reverse a String without using C functions ?

33 Answers   Matrix, TCS, Wipro,






Categories