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

how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y

4 Answers   TCS,


Process by which one bit pattern in to another by bit wise operation is?

0 Answers   InterGraph,


actually i have 2 years teaching experience as computer faculty but now i am a DBA but when i go for interview many peoples asked me why i left my teaching profession and why i want to come in this field kindly give me the proper answer of this queston

3 Answers   Ramco,


Do you know what are the properties of union in c?

0 Answers  


second highest number in a given set of numbers

3 Answers   TCS,






Without Computer networks, Computers will be half the use. Comment.

0 Answers  


how to swap two integers 1 and 32767 without using third variable

11 Answers   Microsoft, TCS,


What is the difference between char array and char pointer?

0 Answers  


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

0 Answers  


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

0 Answers  


How to reverse a linked list

1 Answers   Aricent, Fidelity, IBM, TCS,


What are dangling pointers? How are dangling pointers different from memory leaks?

1 Answers  


Categories