Question: Write a function called show_bits( ). This function must have the following prototype: void show_bits(int); This function must print the bit pattern of the parameter

Write a function called show_bits( ). This function must have the following prototype:

void show_bits(int);

This function must print the bit pattern of the parameter of type int. Compile and test your program. Here are two test cases (data and expected results) to illustrate the behaviour of this function: Test Case 1: If the parameter (int) is 12345, then show_bits( ) prints:

00000000000000000011000000111001

Test Case 2: If the parameter (int) is -12345, then show_bits( ) prints:

11111111111111111100111111000111

language is C

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!