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

Answers were Sorted based on User's Feedback



main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\..

Answer / thilaga

Clearly ans is d.
1<<0 times is 0001.so in decimal 1.
1<<1 times is 0010.so in decimal 2.
1<<2 times is 0100.so in decimal 4.
1<<3 times is 1000.so in decimal 8.
1<<4 times is 0001 0000.so in decimal 16.
thus it becomes 1,2,4,8,16.

Is This Answer Correct ?    24 Yes 2 No

main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\..

Answer / guest

d) L does't make any diff.

Is This Answer Correct ?    22 Yes 4 No

main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\..

Answer / karthi

b.o,1,2,3,4

Is This Answer Correct ?    0 Yes 9 No

main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\..

Answer / aditi

none of them is correct...

coz l does'nt make any diff...

and << means a left shift

o in binary is 0 only...
and wen it is lft shfted it remains same...
1 in binary is 01 >> makes it 010 i.e 2
nd so on...

Is This Answer Correct ?    1 Yes 15 No

Post New Answer

More C Code Interview Questions

main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }

2 Answers  


main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }

2 Answers  


Finding a number which was log of base 2

1 Answers   NetApp,


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

0 Answers  


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

3 Answers  






main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


What are the files which are automatically opened when a C file is executed?

1 Answers  


find A^B using Recursive function

2 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  


main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above

3 Answers   HCL,


Write a procedure to implement highlight as a blinking operation

2 Answers  


main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }

1 Answers  


Categories