/* This is HW is reserve the number with minus sign
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 25th, 2024.
*/
#include <stdio.h>
int main() {
long number_EU; // Changed data type to long
printf("Enter your number:\n");
scanf("%ld", &number_EU); // Changed format specifier to %ld for long
// Store the sign and make the number positive for processing
int sign = 1;
if (number_EU < 0) {
sign = -1;
number_EU = -number_EU;
}
do {
int right_digit = number_EU % 10;
printf("%d", right_digit);
number_EU = number_EU / 10;
} while (number_EU != 0);
if (sign == -1) // If the number was negative, print a minus sign
printf("-");
printf("\n");
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: