Program for using the nested loop - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Program for using the nested loop

Program for using the nested loop



Nested For loops

we can write a for loop within another for loop & while loop such loops are called nested loops.
For Example:
// using the nested loop
class NestedLoop1
{
public static void main(String[]arr)
{
int i=1,j;
while(i<=3)
{
System.out.print(i);//value change from 1to 3

  for(j=1;j<=5;j++)
  {
     System.out.println("\t"+j);// jvalue frome 1 to 5 for every i value data
  }
  i++;
  System.out.println("============");
}
    }
}

That is Output

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.