Regarding the condition statement of the loops in display function

if both i and j have different values then how are we going to take the condition statements?