Question: this lab should be done with the gcc compiler under Cygwin. You must write a command line C program that takes two positive decimal numbers

this lab should be done with the gcc compiler under Cygwin.

You must write a command line C program that takes two positive decimal numbers as arguments when

the program is executed and multiplies the two numbers using Russian or a la russe multiplication.

This will require the use of the left and right shift operation in C as well as the modulus operator. You

will also need the atoi() function which requires the inclusion of the stdlib.h header file in the program.

The range of each number at the command line should be restricted to between zero and 255 decimal.

Your program should check for this condition and report any input error to the user. Your program

should check for any other garbage input from the command line and prompt the user appropriately.

In addition to printing out the result as a decimal value using the printf() function, your program must

print out the result in binary form. This cannot be done directly with printf(), so you will have to write a

function that takes in the ?? bit value and prints each bit of the value to the screen. This will require the

use of C bitwise operators.

The binary value should be written with the MSB to the left and LSB to the right as you would write it

out on paper.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!