What is a c program to reverse a five digit number?

1 answer

Answer

1084157

2026-04-30 02:15

+ Follow

#include <stdio.h>

int main(void){

// Local Declerations

int intNum;

int midDigit;

// Statements

printf("Enter a 5 digit integral number: ");

scanf("%d", &intNum);

//the assignment expression below is used to calculate the mid digit

oneDigit = (intNum % 1000) / 100;

printf("\nThe middle digit is: %d", oneDigit);

return 0;

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.