Check out example codes for "how to create a nested for loop in c". It will help you in understanding the concepts better.

Code Example 1

//Nested for loop in C
int main()
{
   for (int i=0; i<2; i++)
   {
	for (int j=0; j<4; j++)
	{
	   printf("%d, %d\n",i ,j);
	}
   }
   return 0;
}
//Alternative approach to nested for loop
int main()

{
    int i,j;
   for (i=1,j=1 ; i<10 || j<10; i++,j++)
   {
	printf("%d, %d\n",i ,j);
   }
   return 0;

}

Learn ReactJs, React Native from akashmittal.com