Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want clear screeshots for the output program please . Part II: Submit a working code and sample outputs of your program 1. Write a

image text in transcribed

I want clear screeshots for the output program please .

Part II: Submit a working code and sample outputs of your program 1. Write a C function that prints a number in binary on the screen. Assume the number N is passed as an argument to the function, and is of type integer (32 bits). Test your code! 2. Write a C function counts the number of ones (1) in an integer variable N passed as an argument to the function, while testing your code, you may use the place holder %X to display the integer number in hexadecimal Note: Write both functions in one single file and perform different tests on numbers entered by the user. Try also negative numbers! 3. Given the following operation: X = 41.Y + A and assuming the variables X, Y and A integer variables, do the following: a. Using the multiplication instructions, write a C code that performs the above task. b. Now, without using the multiplication instruction, write a C code that uses left and right shifts and addition or subtraction to perform the same task. Note: Write part b as a function that accepts A and Y as inputs and returns X

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions