Home C Programming Language / Programs / Nested For Loop in C
🚀 Programming Example

Nested For Loop in C

👁 1,277 Views
💻 Practical Program
📘 Step Learning
Nested for loop in c programming language

💻 Program Code

#include <stdio.h>
int main()
{
	int i, j;
   for (i=0; i<2; i++)
   {
	for (j=0; j<4; j++)
	{
	   printf("%d, %d\n",i ,j);
	}
   }
   return 0;
}
                        

🖥 Program Output

0, 0
0, 1
0, 2
0, 3
1, 0
1, 1
1, 2
1, 3
Press any key to continue . . .
                            

📘 Explanation

Nested for loop in c programming language
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.