#include<stdio.h> #include<conio.h> void main() { int n; clrscr(); printf("Enter Decimal Number: "); scanf("%d",&n); printf("Hexadecimal value is: %x",n); getch(); }
It is 138.
58 =3a
10 = A
351
224 = E0
A45C: Decimal = 42076 Octal = 122134
BB895C: Octal = 56704534 Decimal = 12290396
pongada punda vayanungala ..................
221122: Binary = 1000100001000100100010 Octal = 10410442 Decimal = 2232610
This is not a question.
BA = 11*16 + 10 = 176 + 10 = 186
Whether or not you can do that depends on the size of the number. If the number in question is greater than [decimal] 66535, then you cannot.
10011101: Decimal = 157 Hexadecimal = 9D
The way I convert between decimal and hexadecimal is to first convert the decimal number to binary: 664062510 = 110010101010011111100012 Then split the binary number into 16-bit (4 digit) chunks: 0110 0101 0101 0011 1111 00012 Next, convert each chunk into a hexadecimal digit: 0110 0101 0101 0011 1111 00012 6 5 5 3 F 1 Finally, put all the digits together: 664062510 = 6553F116
Write a program to convert a 2-digit BCD number into hexadecimal
#include<stdio.h> #include<conio.h> void main() { int n; clrscr(); printf("Enter Decimal Number: "); scanf("%d",&n); printf("Hexadecimal value is: %x",n); getch(); }