answersLogoWhite

0


Best Answer

write an assembly language program to implement a stack. START: LXI SP,STACK ;initialize stack pointer

LXI H,BINBYT ;point HL index to where binary number is stored

MOV A,M ;transfer byte

LXI H,OUTBUF ;point HL index to output-buffer memory

CALL BINBCD

HLT BINBCD:

MVI B,100 ;load 100 into register B (power of ten holding register)

CALL BCD ;call conversion for BCD3

MVI B,10 ;load 10 into register B

CALL BCD ;call conversion for BCD2

MOV M,A ;store BCD1

RET

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Assume read from Console

string inputString = Console.ReadLine();

int inputDecimalValue = int.Parse(inputString);

//Now convert the input decimal value to a binary representation, as a string

string binaryString = Convert.ToString(inputDecimalValue, 2); // 2 means binary base

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Use manipulator for cout stream dec which automatically converts to decimal representation.

...
#include
...

int main()
{
...
cout << ... << dec << ...;
...

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

write an algoriths/program that accepts an input as a decimal number and converts it into binary representation in c.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to convert hexadecimal to decimal numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


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


Algorithm of conversion decimal to hexadecimal?

The hexadecimal notation is base-16, so for small numbers, arrange them right to left as powers of 16 (units 0 to 9 and A through F representing 10, 11, 12, 13, 14, and 15).Examples: 21 = 15 hex (16+5) and 31 = 1F (16+15)For larger numbers, see the process at the related link below.Here is a program:#include#includevoid main(){int n;clrscr();printf("Enter Decimal Number: ");scanf("%d",&n);printf("Hexadecimal value is: %x",n);getch();}


Write a program that prints a table of the binary octal and hexadecimal equivalents of the decimal numbers in the range 1 through to 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(); } }


A c program to convert decimal number to decimal number?

The question asks to do nothing by converting a decimal into itself. Perhaps the question was mistyped. Please restate the question.

Related questions

Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


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

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


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL


What is SAP give you the brief solution?

Write a program to convert a 2-digit BCD number into hexadecimal


What is one tool for reverse engineering software and five features of that tool?

hexadecimal dumper, which prints or displays the binary numbers of a program in hexadecimal format.


How do you convert binary to hexadecimal using assembly language?

In order to convert binary to hexadecimal using assembly language, the programmer must possess an understanding on boolean algebra or binary system in other words. A compiler is also needed to complete the program.


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


Program to convert hex to decimal in 8085?

jump,b


What is hexadecimal code?

Computer engineers use to use the hexadecimal code to program computers, or the base 16. Hexadecimal numbers use the digits 0 through 9, plus the letters A through F to represent the digits 10 through 15.


Write a program to convert decimal numberto hexadecimal number?

One way to accomplish this is to allow the printf statement to do the work for you. Example: printf("Decimal %d = hex %02x\n", number, number); Or you could use the windows calculator. Select the Dec radian, type your number in, then select Hex radian.


Algorithm of conversion decimal to hexadecimal?

The hexadecimal notation is base-16, so for small numbers, arrange them right to left as powers of 16 (units 0 to 9 and A through F representing 10, 11, 12, 13, 14, and 15).Examples: 21 = 15 hex (16+5) and 31 = 1F (16+15)For larger numbers, see the process at the related link below.Here is a program:#include#includevoid main(){int n;clrscr();printf("Enter Decimal Number: ");scanf("%d",&n);printf("Hexadecimal value is: %x",n);getch();}