WAP – represent a char in binary format

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to swap two numbers without using the third variable?

604


When would you use a pointer to a function?

591


What is the difference between fread and fwrite function?

642


How many types of operators are there in c?

623


What is the main difference between calloc () and malloc ()?

576






What is an array in c?

599


Can a local variable be volatile in c?

584


Explain #pragma statements.

608


Why is sizeof () an operator and not a function?

593


Is c is a procedural language?

601


What is atoi and atof in c?

620


Why doesnt this code work?

621


Why do we use int main?

618


What is use of #include in c?

603


What is structure of c program?

609