Created
April 28, 2021 10:38
-
-
Save syedjafer/89958aa47625b3cefb139e284719d303 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReverseNum{ | |
public static void main(String []args){ | |
int arr[] = {1, 2, 3, 4, 5, 6}; | |
int output_array[]=new int[6]; | |
for (int itr=0, ctr=5; ctr >=0; ctr--, itr++){ | |
output_array[itr] = arr[ctr]; | |
} | |
for(int itr=0; itr<6; itr++){ | |
System.out.println(output_array[itr]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment