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

Answers were Sorted based on User's Feedback



main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n"..

Answer / guest

d) bit's value is not changed

Is This Answer Correct ?    27 Yes 1 No

main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n"..

Answer / shanker

Query : When bits cant be changed, then option c is also
correct?

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Code Interview Questions

Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


#define a 10 int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } void foo() { #undef a #define a 50 }

3 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

2 Answers   Mentor Graphics, Microsoft,






write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

0 Answers   Nagarro,


main() { char a[4]="HELLO"; printf("%s",a); }

3 Answers   CSC,


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

2 Answers  


main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)

4 Answers   HCL,


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

1 Answers  


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,


Categories