answersLogoWhite

0

#include <stdio.h>

int main()

{

unsigned int a;

char buffer[33];

scanf("%x",&a);

if(a==0)

{

putchar('0');

return 0;

}

char *cp = buffer + 32;

*cp = 0;

while(a)

{

--cp;

if(a & 1) *cp = '1';

else *cp = '0';

a >>= 1;

}

printf(cp);

return 0;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the 4 bit binary for the hexadecimal symbol C?

1100


What is the 4-binary number assoiated with the hexadecimal symbol C?

0xc = 1100 Hexadecimal digits use exactly 4 binary digits (bits). The 0x0 to 0xf of hexadecimal map to 0000 to 1111 of binary. Thinking of the hexadecimal digits as decimal numbers, ie 0x0 to 0x9 are 0 to 9 and 0xa to 0xf are 10 to 15, helps with the conversion to binary: 0xc is 12 decimal which is 8 + 4 &rarr; 1100 in [4 bit] binary.


WHAT IS THE 4 BIT BINARY NUMBER ASSOCIATED WITH HEXADECIMAL SYMBOL C?

The answer is 1100.


Write a program of binary heap in c or c language?

to implement operations on binary heap in c


Write a program that prints a table of the binary, octal and hexadecimal equivalents of the decimal numbers in the range 1 through 256?

import java.util.Scanner; public class NumberSystem { public void displayConversion() { Scanner input = new Scanner(System.in); System.out.printf("%-20s%-20s%-20s%-20s\n", "Decimal", "Binary", "Octal", "Hexadecimal"); for ( int i = 1; i &lt;= 256; i++ ) { String binary = Integer.toBinaryString(i); String octal = Integer.toOctalString(i); String hexadecimal = Integer.toHexString(i); System.out.format("%-20d%-20s%-20s%-20s\n", i, binary, octal, hexadecimal); } } // returns a string representation of the decimal number in binary public String toBinaryString( int dec ) { String binary = " "; while (dec &gt;= 1 ) { int value = dec % 2; binary = value + binary; dec /= 2; } return binary; } //returns a string representation of the number in octal public String toOctalString( int dec ) { String octal = " "; while ( dec &gt;= 1 ) { int value = dec % 8; octal = value + octal; dec /= 8; } return octal; } public String toHexString( int dec ) { String hexadecimal = " "; while ( dec &gt;= 1 ) { int value = dec % 16; switch (value) { case 10: hexadecimal = "A" + hexadecimal; break; case 11: hexadecimal = "B" + hexadecimal; break; case 12: hexadecimal = "C" + hexadecimal; break; case 13: hexadecimal = "D" + hexadecimal; break; case 14: hexadecimal = "E" + hexadecimal; break; case 15: hexadecimal = "F" + hexadecimal; break; default: hexadecimal = value + hexadecimal; break; } dec /= 16; } return hexadecimal; } public static void main( String args[]) { NumberSystem apps = new NumberSystem(); apps.displayConversion(); } }


Need a assembly language code for converting hexadecimal to bcd?

No, it can be done in C.


What are the examples of middle level programming language?

binary language


Binary representation of 0xCA?

The hexadecimal value 0xCA can be converted to binary by converting each hex digit to its 4-bit binary equivalent. The hex digit 'C' corresponds to the binary 1100, and 'A' corresponds to 1010. Therefore, the binary representation of 0xCA is 11001010.


Write a C program to convert hexadecimal number into decimal number?

pongada punda vayanungala ..................


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


How do you convert A B C in binary code?

A = 1010 b = 1011 c = 1100


C program to receive floating point and convert it into binary?

scanf