main()

{

int i = 0xff ;

printf("\n%d", i<<2);

}

a. 4

b. 512

c. 1020

d. 1024

Answers were Sorted based on User's Feedback



main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 ..

Answer / pavan_mustyala

binary representation of 0xff is 11111111

left shift by 2 results in 1111111100 which is equivalent
to 1020 in decimal.

Is This Answer Correct ?    22 Yes 0 No

main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 ..

Answer / guest

c) 1020

Is This Answer Correct ?    19 Yes 0 No

Post New Answer

More C Code Interview Questions

Implement a t9 mobile dictionary. (Give code with explanation )

1 Answers   Amazon, Peak6, Yahoo,


Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.

5 Answers   IITR, Microsoft, Nike,


How can you relate the function with the structure? Explain with an appropriate example.

0 Answers  


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  






main() { char not; not=!2; printf("%d",not); }

1 Answers  


how to check whether a linked list is circular.

11 Answers   Microsoft,


Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.

1 Answers  


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,


Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.

1 Answers   Samar State University,


main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers  


main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }

1 Answers  


Categories