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

please send me the code for multiplying sparse matrix using c

0 Answers  


What is pointer & why it is used?

0 Answers  


2. Write a function called hms_to_secs() that takes three int values&#8212;for hours, minutes, and seconds&#8212;as arguments, and returns the equivalent time in seconds.. Create a program that exercises this function by repeatedly obtaining a time value in hours, minutes, and seconds from the user (format 12:59:59), calling the function, and displaying the value of seconds it returns.

5 Answers   TCS,


how many error occurs in C language ?

22 Answers   Infosys, Wipro,


C program to find frequency of each character in a text file?

6 Answers  


What is the difference between static and global variables?

1 Answers  


What is the difference between call by value and call by reference in c?

0 Answers  


what is a function pointer and how all to declare ,define and implement it ???

4 Answers   Honeywell,


how to capitalise first letter of each word in a given string?

0 Answers  


can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance

1 Answers   IBM,


Can a pointer be volatile in c?

0 Answers  


write an algorithm and a program to count the number of elements in a circularly singly linked list

1 Answers   Ignou,


Categories