I want to restart my for-loop. I have a homework problem, in which I have to tell the coordinates of user given word (one alphabet at a time) in a 2D array of A to Z.
for example : if the user gives a word "GREAT", then the program have to print the coordinates of each letter's location in a jagged array. (G - 1,1 , R - 3,2 , E - 2,1, A - 0,0 , T - 3,4)
Using nested for loops, I'm able to print forward characters (what I mean is, the word "GOT" have characters going from A to Z) and if I try "GET" (here, after 'G', 'E' is going backward), the program stops after 'G'. So, I guess if I could restart the loop after each letter's coordinates is printed, I could print all the coordinates.
`//2D array
char a[][] = {{'A','B','C','D','E'},{'F','G','H','I','J'},{'K','L','M','N','O'},{'P','Q','R','S','T'},{'U','V','W','X','Y'},{'Z'}};
//if the user given word is GET,
//then the output should be
//G-1,1
//E-0,5
//T-3,5`