0
How can i reverse an ARRAY (from left to right)
4 odpowiedzi
+ 6
int temp;
int a [l];
for (int i=0;i <l;i++)
{
temp=a [i];
a[i]=a[l-i];
a [l-i]=temp;
}
+ 2
print the array reversely.use decrease for loop array length to zero
+ 2
you can go through the array reversely.Write its own rutine which starts on the end and decrease the array index:
for(int ridx=arr.length;ridx>0;ridx--)
printf(%d, arr[ridx-1]);
+ 2
بس شوفك بقلك كيف 😆