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

What are the standard predefined macros?

0 Answers  


12344321 123 321 12 21 1 1 how i print this program??

5 Answers   DSR Management, Winit,


Finding first/last occurrence of a character in a string without using strchr( ) /strrchr( ) function.

2 Answers  


What is main () in c?

0 Answers  


write a program to print the all 4digits numbers & whose squares must me even numbers?

2 Answers   Virtusa,






What is const and volatile in c?

0 Answers  


Explain the difference between the local variable and global variable in c?

0 Answers  


What are the different types of C instructions?

0 Answers   InterGraph,


1) int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain the explain the output

2 Answers  


Without using main fn and semicolon,print remainder for a given number in C language

2 Answers  


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

0 Answers   CSC, Wipro,


Linked lists -- can you tell me how to check whether a linked list is circular?

0 Answers  


Categories