Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 programs variables must be sensibly named.

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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