+ 1

Convert Binary to hexadecimal

I want to convert 7 Binary numbers from user to hexadecimal in cpp

29th Jan 2017, 6:29 PM
Abhijit Mangale
Abhijit Mangale - avatar
2 Antworten
0
If you read the input as a char[] you can use int x = strtol(input, NULL, 2); /* <stdlib.h> */ to store the input in x and printf("%X",x); /* <stdio.h> */ to print it out as hexadecimal number.
29th Jan 2017, 6:49 PM
Robobrine
Robobrine - avatar
0
10110100
28th Mar 2023, 2:33 PM
Gemechis Befikadu
Gemechis Befikadu - avatar