Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about base-conversion

Read more about base-conversion

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - base-conversion

Why does this algorithm convert decimal to hexadecimal numbers?

I can't quite seem to figure out how does such algorithm work... Code: #include <stdio.h> int main(void){ int number = 0; while(number < 16){ if(number < 10){ printf("decim...
test-img

user13343210

c

ascii

base-conversion

Votes: 0

Answers: 1

Latest Answer

When you change printf("hexadec.: \t%c\n", number - 10 + 'A'); to this: printf("hexadec.: \t%c\n", number - 9 + 'A'); the first letter you get when 'number' is over 10 is 'B'. ...
test-img

zlSxrtig

How do I convert an integer command-line argument i to base k with bases up to 16 using the letters A through F for the digits 11-16 , respectively?

Question prompt: Modify Binary to get a program that takes two integer command-line arguments i and k and converts i to base k. Assume that i is an integer in Java’s long data type and that k is an in...
test-img

silicongolem

java

if-statement

while-loop

switch-statement

base-conversion

Votes: 0

Answers: 2

Latest Answer

If you need to convert an integer (which is base 10) to any other base using a single switch statement you can use something like this: int i = //take from CLI int k = //take from CLI int num = i; //...
test-img

Thomas

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved