#include<stdio.h>
int main()
{
int n,i,x,r;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
x=a[i];
while(x)
{
r=x%10;
x=x/10;
printf("%d",r);
}
printf("\n");
}
return 0;
}
Your code isnt printing in required format.
For numbers like 90, your code prints “09” instead of “9” . Just make sure if the number ends with 0, then dont print the leading zero.
Thank you…