#include <stdio.h>
#include <conio.h>
void main()
{
int arr[5], new[5], i, j;
printf("ENTER ANY FIVE NUMBERS:");
scanf("%d%d%d%d%d", &arr[0], &arr[1], &arr[2], &arr[3], &arr[4]);
for(i=0; i<5; i++)
{
for(j=5; j>=0 ;--j)
{
new[i] = arr[j];
printf("%d", new[i]);
printf(" ");
}
}
getch();
}
The above code is of a simple problem, which asks to take inputs of numbers in an array and show the inverse array of the input. I tried to solve it myself and wrote the above code. But the compiler is showing the result multiple times, I mean, the result should have only 5 numbers but the output shows series of numbers.