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

On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

0 Answers  


what is difference between null and nul in c language

2 Answers  


write a program that finds the factorial of a number using recursion?

13 Answers   Infosys, TATA,


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

0 Answers  


How can I do serial ("comm") port I/O?

0 Answers   Celstream,






write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

0 Answers  


Differentiate fundamental data types and derived data types in C.

0 Answers   HCL,


Write a program to print numbers from 1 to 100 without using loop in c?

0 Answers  


how to find the binary of a number?

10 Answers   Infosys,


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

0 Answers  


What is break in c?

0 Answers  


Method Overloading exist in c ?

3 Answers   Wipro,


Categories