Wrong Answer FLOW007

Here is my code for PROBLEM FLOW007. Output is correct but it still says Wrong Answer on submitting.

int main()
{
	int T, N, i, rev;
	scanf("%d", &T);
	int arr[T];
	for(i=0;i<T;i++){
		scanf("%d", &arr[i]);
	}
	for(i=0;i<T;i++){
		while(arr[i]>=10){
			rev=arr[i]%10;
			printf("%d",rev);
			arr[i]=arr[i]/10;	
		}
		printf("%d\n", arr[i]);
	}
}

Did you try out the actual test cases given and check that the output was an exact match for the expected output given? Because that doesn’t happen for your code above.

FLOW007, “Reverse The Number” has relatively friendly public test cases that exercise your code more fully. You will encounter plenty of challenges here where you have to anticipate edge cases that don’t occur in the given “worked” test set.

1 Like

In While Loop arry [i] should not be greater than 10. i.e
while(arr[i]<=10).
Try It.
This might solve your problem.