Question: EE1311 Homework 5 You must write a C program that prompts the user for two numbers ( no command line input) and multiplies them together
EE1311 Homework 5
You must write a C program that prompts the user for two numbers (no command line input) and multiplies them together using a la russe multiplication. The program must display your banner logo as part of the prompt to the user. The valid range of values is 0 to 4000. Assume that the user will always enter numerical decimal format values. Your program should check this numerical range and re-prompt the user for correct input if necessary. The program must also allow the user to enter a character to exit the program back to the terminal prompt. The program should print the result in decimal format and binary format. The binary output should use the least number of bits to display the number in multiples of 8 bits. I.e., anything less than 256 should display as 8 bits, anything less than 64k should use 16 bits. The value 4000 times 4000 should only need 24 bits.
You may NOT use any libraries other than stdio.h
You may NOT use the multiplication operator or the division operator
o Use bitwise shifting to halve and double numbers
You must use two source files
o One source file will contain the main() function, global variables, and proper function prototypes.
o The other source file will contain all other functions as specified below
o The program must be built using the compile command like Tutorials Point p27
You must have the following four functions
o One function that prints your logo banner
o One function that takes in a value and prints it in binary format
o One function that prompts the user for input and qualifies those values
o One function that takes in the two values, multiplies them and returns the result.
The variables for the two numbers and the result must be kept in local variables defined in the main function. And none of these variables may be returned from a function call. This means that to change the value in these variables, they must be passed by reference to a function and the function must update the value at the variables address location.
There can be no magic numbers in the code
o Any constants must be defined with a Macro
NOTE
I HAVE THE FUNCTION FOR THE BANNER
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
