problem 18


#include <stdio.h>

int main() {
    int n, r; // Variable to store the number and its reverse
    printf("Enter a value of n: ");
    scanf("%d", &n);

    // Loop to reverse the digits of the number
    while (n > 0) {
        r = n % 10;
        printf("%d", r);
        n = n / 10;
    }
    return 0;
}



Contact Form