{
public static void main(String[] args)
{
for(int i = 0; i <5;i ++ )
{
System.out.print("1");
for(int b = 1;b < 5; b++)
{
System.out.print(b);
}
System.out.println();
}
}
}
/*help plz
right now it prints.....
11234
11234
11234
11234
11234
however i need to print....
1
12
123
1234
12345
but i cant figure out how to make it do this with just 2 loops
Press any key to continue...
*/
CODE
public class nestedforloops
{
public static void main(String[] args)
{
for(int i = 0; i <5;i ++ )
{
System.out.print("1");
for(int b = 1;b < 5; b++)
{
System.out.print(b);
}
System.out.println();
}
}
}
{
public static void main(String[] args)
{
for(int i = 0; i <5;i ++ )
{
System.out.print("1");
for(int b = 1;b < 5; b++)
{
System.out.print(b);
}
System.out.println();
}
}
}










