Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone help? This code needs to be done in C. Thanks. Problem 2. Number Base Conversion (30 points) Write a program that takes a
Can anyone help? This code needs to be done in C. Thanks.
Problem 2. Number Base Conversion (30 points) Write a program that takes a decimal integer as input and converts it to the corresponding number in binary and octal. You are required to write functions for the conversion and call it from the main function. You have to use at least three functions. The hexadecimal letters have to be uppercase like in the sample output. You can use recursion or arrays. For conversion techniques, check the following links https://medium.com/@jamesjeffe htt ow-to-convert-decimal-to-binary-7256d7d82b07 stems3.html robotroom.com/Numb . Write a function for each base conversion 25 points Write in the comments at the start, why did you choose-5 points . o Recursion vs loops using arrays o If iteration, why that type of loop (from the 3 we saw in the lab) o If you used if-else vs switch, why that one? (Your code should print the red texts on the screen. Black texts are sample user inputs. No prints to ask for the input.) Sample Input Sample Out 34 34 in Binary: 100010 34 in Octal: 42 34 in Hexadecimal: 22 9 in Binary: 1001 9 in Octal: 11 9 in Hexadecimal: 9 475 in Binary: 111011011 475 in Octal: 733 475 in Hexadecimal: 1DB 475Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started