/*This is the seventhth lab of Lab EE107
The purpose of this lab understand how a program Use do while
instead of while statement.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 12th, 2024.
    */
#include <stdio.h>

int main() {
    // Input value
        int number_EU, reversedNumber_EU = 0, remainder_EU;

    // Get user input
    printf("Enter a number: ");
    scanf("%d", &number_EU);

    // Reverse the digits using a do-while loop
    do {
        remainder_EU = number_EU % 10;
        reversedNumber_EU = reversedNumber_EU * 10 + remainder_EU;
        number_EU /= 10;
    } while (number_EU != 0);

    // Display the reversed number
    printf("Reversed number: %d\n", reversedNumber_EU);

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: