Nested Loop C Programming Code Example


Example: how to create a nested for loop in c

//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;  }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools