Tuesday, March 5, 2024

14. Print the digit in reverse :—

14. Print the digit in reverse :—


#include<stdio.h>

int main()

{

    int r,n;

    printf("enter a value of n ");

    scanf("%d",&n);

    while(n>0)

    {

        r=n%10;

        printf("%d",r);

        n=n/10;

    }

    return 0;

}


No comments:

Post a Comment