Home / Expert Answers / Computer Science / write-a-complete-c-program-that-reads-in-the-last-2-digits-of-your-student-id-into-a-single-variable-pa649

(Solved): Write a complete C program that reads in the last 2 digits of your student ID into a single variable ...



Write a complete C program that reads in the last 2 digits of your student ID into a single variable. The program converts that number to its octal equivalent and displays a message with both the original number and its octal value. If the last two digits are both a zero digit (0), then the program should replace that with value 44.

Below is an example of running the program with a specific input value:

   Enter the last two digits of your ID: 24
   Result: 24 is 30 in octal

Notes:

 

The program must not use in-built C functions; the exception to this are scanf() and printf().

The only repetition structure you can use is a do-while loop.

The program’s variables must be sensibly named.

The code must include comments that are meaningful, short and clear, to explain all major parts of the program.



We have an Answer from Expert

View Expert Answer

Expert Answer


Here is a complete C program that meets the requirements you specified:#include int main(void) { // Declare variables to store the last two
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe