1. START
  2. Input Any number as Gno
  3. Calculate r1 =Gno%10
  4. Assign no1 =Gno/10
  5. Calculate r2 =no1%10
  6. Assign no2 =no1/10
  7. Calculate r3 =no2%10
  8. Assign no3 =no2/10
  9. Print value of r1,r2,r3,no3
  10. END

Flowchart to take a 4-digit number by user and print it in reverse manner.  (using modulus operator %)

reverse digits
reverse digits

Write a C program to take a 4-digit number by user and print it in reverse manner using modulus operator %)

#include<stdio.h>
void main()
{
int gno,r1,r2,r3,no1,no2,no3;
printf("Enter any 4-digit number :");
scanf("%d",&gno);
r1=gno%10;
no1=gno/10;
r2=no1%10;
no2=no1/10;
r3=no2%10;
no3=no2/10;
printf("The given number in reverse order is %d %d %d %d ", r1,r2,r3,no3);
}