Question: Convert from pseudo code to C Require: int *n, MAX set in to 0 declare a char variable, c read a single character from the

 Convert from pseudo code to C Require: int *n, MAX set

Convert from pseudo code to C

Require: int *n, MAX set in to 0 declare a char variable, c read a single character from the terminal and store the character into a if c is an empty space then return 1 end if if c is a newline character then return 0 end if declare an int variable, flip if c='_' then set flip to -1 else if c ='+' then set flip to +1 else set flip to 0 end if while c is not an empty space or a newline character do read a single character from the terminal if c is a numerical character then let *n = *n * 10 let *n = *n+I, where r is the integer value represented by character c end if end while cap *n to MAX by letting *n = *n%MAX make the integer signed by letting *n=flip**n if c is a newline character then return 0 else return 1 end if

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!