WAP – represent a char in binary format

Answers were Sorted based on User's Feedback



WAP – represent a char in binary format ..

Answer / vinayml

main()

{

char p = 'a' ;

int i = 0 ;



for( i = 0 ; i < 8 ; i++)

( p & (1 << i )) ?printf ("1"): printf("1");

}


Is This Answer Correct ?    0 Yes 0 No

WAP &#8211; represent a char in binary format ..

Answer / johnson

?eh? this doesn't make sense. The answer will obviously be
11111111.

Is This Answer Correct ?    0 Yes 0 No

WAP &#8211; represent a char in binary format ..

Answer / kalpana.y



738211

Is This Answer Correct ?    0 Yes 0 No

WAP &#8211; represent a char in binary format ..

Answer / civa

#include <stdio.h>
main()

{

char p = 'a' ;

int i = 0 ;



for( i = 0 ; i < 8 ; i++)

( p & (1 << 7-i )) ?printf ("1"): printf("0");

}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

will the program compile? int i; scanf(ā€œ%dā€,i); printf(ā€œ%dā€,i);

3 Answers  


Explain what is operator promotion?

0 Answers  


How. To pass the entrance test

1 Answers   Tech Mahindra,


write a program for odd numbers?

15 Answers  


LOGIC OF Bodmas?

1 Answers  






what is object oriental programing?

1 Answers  


What is optimization in c?

0 Answers  


what is the difference between structure and union?

3 Answers  


const char * char * const What is the differnce between the above tow?.

6 Answers   Ramco, TCS,


what is meant by the "equivalence of pointers and arrays" in C?

3 Answers   Satyam,


write a program to generate address labels using structures?

0 Answers   SJC,


program to find the ASCII value of a number

8 Answers  


Categories