Write a C program, base.c which prompts the user for a base 10 integer (961) and converts the integer into binary (base 2) and hexadecimal (base 16).

Note: Do not perform your own calculations and have your program output the results. All of the calculations for the lab should be performed within your program. Use the following guidelines to develop your program:

Declare your variables with appropriate data types.

Assign values to your values.

Perform your calculations.

Generate appropriate output.

Points to Remember:

Make sure you are creating a C program and not a C++ program. The .c suffix to your source code will invoke the C compiler while the .cpp suffix will invoke the C++ compiler. As this is a class in C and not C++, please make sure your source code uses the .c suffix. You should not be using any global variables in your program. A global variable is a variable declared outside of main().

Output from your program should be sent to the terminal window (your screen) as well as the requested csis.txt output file.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.