Reverse The Number Problem Code: FLOW007.PLEASE ANYONE HELP ME.

/I am little bit confident that my code is correct but when I was submitted this answer It was showing the wrong answer/
#include<stdio.h>
int main()
{
int n,s,a[100000],t,j,i;
scanf("%d",&t);
for(j=0;j<t;j++)
{
scanf("%d",&n);
int count=0;
while(n!=0)
{
s=n%10;
a[count]=s;
n=n/10;
count++;
}
for(i=0;i<count;i++)
{printf("%d",a[i]);}
printf("\n");
}
return 0;
}

Test case

1

05

Expected output

50

Your output

5

Here you can use a string to store the number and then reverse it because even the predecessor zero are counted .

import java.lang.;
import java.math.
;
import java.io.;
import java.util.
;

public class Reverse{
	public static void main(String[] args){
			Scanner s1=new Scanner(System.in);
			int n = s1.nextInt();
			for(int i=0;i<n;i++){
					int number = s1.nextInt();
					for(int j=number;j!=0;j=j/10){
							int x = j%10;
								System.out.print(x);
					}
					System.out.println();
			}
					
	}
}

MY SOLUTION

Thank you!