CS Electrical And Electronics
@cselectricalandelectronics

There is some small error in nested loop of c language? Can anyone solve this?

All QuestionsCategory: C LanguageThere is some small error in nested loop of c language? Can anyone solve this?
CS Electrical And Electronics Staff asked 4 years ago

The actual answer I should get is this.

Output:

i=1     j=1
i=1     j=2
i=2     j=1
i=2     j=2
i=3     j=1
i=3     j=2

Code:

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

This code has some error, after running this code I am getting nothing at the output, the output is empty.