I want to convert some numbers to binary, octal, and hexadecimal.. for example: . DECIMAL......BINARY......OCTAL.....HEXADECIMAL ................................................................... 1.................00000001.....001.......1 2.................00000010.....002.......2 And so on..

Member Avatar
Member Avatar
+0 forum 1

Hello all. I'm writing a program that converts from any cominbation of base 2, 8, 10, and 16. So far I have this code and I want to convert from hexadecimal to octal but it doesn't work. I would appreciate any help. Thank you! Here is the code: #include "stdafx.h" #include <iostream> #include <string> #include <cmath> #include <fstream> #include <iomanip> #include <bitset> #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <limits> #include <sstream> #include <bitset> #define ULONG unsigned long #define FALSE 0 #define TRUE 1 #define BOOL int #define MAX 1000 using namespace std; void B2D(); void B2O(); void B2H(); void …

Member Avatar
Member Avatar
+0 forum 6

Hi everyone I'm stuck on a school project. The Following is the prompt: > Write an assembly language program that prompts the user to enter a string to be interpreted as an 8-digit hexadecimal number. Your program must convert the ASCII string representation of this hexadecimal number into a 32-bit unsigned binary number. Then, your program must prepare and store an ASCII string for the octal (base 8) representation of the same number and print it out.Your program should generate an error if the input string contains a character that is not 0 through 9 or A through F (except …

Member Avatar
+0 forum 0

Hi Guys, I have written the below program to convert binary to octal, it is giving me erroneous results. On entering 1111 as the input number I should get 17 as the output, whereas I am getting 16707000337 as the output. Kindly help me out, below is my program: /*program to convert binary to octal*/ #include<math.h> #include<stdio.h> #include<stdlib.h> int main() { int bin,dec[100]={0},i=0,j=0,k=0,num=0,output[100]={0},number=0,rem1,rem,output1; printf("enter the binary number to be converted into octal"); scanf("%d",&bin); rem1=bin; /*counts the number of digits in the input binary number*/ while(rem1!=0) { rem1=rem1/10; num+=1; } /*converts binary number to decimal */ for(i=0;i<num;i++) { number=bin%10; bin=bin/10; dec[i]=pow(2,j)*number; …

Member Avatar
Member Avatar
+0 forum 2

I am to write a program that converts either binary, hex or octal to decimal. We are to use methods for the first time (Not a problem). I have written almost all of the code but the conversion. We can't use int.toDecimal or any shortcut. All must be long coded so that we learn something from the process. I have looked for the past 3 days trying to find the answer to how this should be accomplished and have found nothing. My question is how to take an input of either an integer or string and output it in one …

Member Avatar
Member Avatar
+0 forum 23

Hello, I would like some help on this one problem in my assignment. I have completed the table but something caught my attention and i feel i did something wrong. I attached the same table i filled out on this thread. I would like help on the first row. My answers for the first row was: 18 ? 0x12 22 ? I think the answer for the 2's complement is 0001 0010 (binary) because im assuming its asking to represent the decimal in 2's complement format. So if thats the case, Sign magnitude column should also be 0001 0010, am …

Member Avatar
Member Avatar
+0 forum 2

hi i really need help, i m trying to write a program that displays in a textbox a talbe of the binary, octal, and hexadecimal equivalents of the decimal numbers in range 1-222. Plz help i m new to vb....Thks you

Member Avatar
Member Avatar
+0 forum 3

The End.