Question: ParWrite a function digitize (using loops) that takes two parameters: one integer parameter and one bool parameter. The function would print the integer one digit

ParWrite a function digitize (using loops) that takes two parameters: one integer parameter and one bool parameter. The function would print the integer one digit at a time each on a separate line. If the bool parameter passed were true, the function would print the digits from the most significant digit to the least significant. Otherwise, it would print it in the reverse order (least significant to most significant).

Function Call OUTPUT
digitize(1758,true)

1

7

5

8

digitize(1758,false)

8

5

7

1

Part B)

Write a function (without using loops) that reverses the digits in an integer and prints out the integer in this reverse form. It is not necessary to calculate the value of the reverse integer, just print out the digits in reverse order. The function should be called reverse.

PLEASE USE COMMENTS TO HELP ME GET THIS

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!