Skip to content

Chinilshik-kalkulatorov/Extra_task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Conversion of Hexadecimal Number A200

This repository contains the program extra_c.c, which converts a hexadecimal number to binary and decimal representations, including two's complement representation for a 16-bit processor.

Program Description

The extra_c.c program performs the following tasks:

  1. Converts a hexadecimal number to its binary representation.
  2. Converts a hexadecimal number to its decimal representation (unsigned).
  3. Converts a binary number to its decimal representation, considering the two's complement.

Compilation and Execution

To compile and run the program, follow these steps:

  1. Compile the program using the gcc compiler:

    gcc extra_c.c -o extra_c
  2. Run the compiled program:

    ./extra_c

Example Output

After running, the program will display the conversion results for the hexadecimal number A200:

Hexadecimal: A200
Binary (16 bits): 1010001000000000
Decimal (unsigned): 41472
Decimal (two's complement): -24064

Releases

No releases published

Packages

No packages published

Languages