Using the nested for loop, write a snippet code to display the following output. Output: H?H?H?H?H? A*A*A*A* H?H?H? A*A* H?
for(int i = 0; i < 1 ; i++) { for (int ia = 0; ia<2; ia++) { for(int ib = 0; ib<3; ib++) { for(int ic = 0; ic<4; ic++) { for(int id=0; id<5; id++) { print H? endline } print A* endline } print H? endline } print A* endline } print H? }
actually I misplaced the endlines, but you get the general idea
Join our real-time social learning platform and learn together with your friends!