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

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?