How to print array elements in anticlockwise direction in a 2 dimensional array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to print array elements in anticlockwise direction in a 2 dimensional array

31st Oct 2017, 12:58 PM
karthik rao K.C
karthik rao K.C - avatar
2 Answers
+ 1
use a for loop initialise its variable length with length of that array.
31st Oct 2017, 1:45 PM
shobhit
shobhit - avatar
- 1
if this is clockwise: for (I = 0; I < arr.length(); I++) then this is anticlockwise: for (I = arr.length()-1; I >= 0; I--)
31st Oct 2017, 1:56 PM
John Wells
John Wells - avatar