Question: C programming question. hi .... The user gives me a number between 1 and 70000, I need to print this value out onto the console

C programming question.

hi ....

The user gives me a number between 1 and 70000, I need to print this value out onto the console using two bytes of char type, even if the number is less than 255 I need the first byte to be 0, example: number = 7, my output is 00 07. The instructor suggested printing a single character, which works for numbers <255, but how do I print a number >255 as 2 characters? The professor said to use char type and bitwise operations. thank you.

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!