s3a
September 24th, 2009, 06:46 PM
On my programming assignment, here is the code I used to answer question 1:
public class Q1
{
public static void main (String [] args)
{
for(int number = 1; number <= 100; number += 1)
{
System.out.printf("%2d ", number);
if((number%10) == 0)
System.out.println();
}
}
}
"Repeat exercise 1, but this time use two for loops, one nested within the other."
Can someone please give me an example of how to do this?
Any help would be greatly appreciated!
Thanks in advance!
public class Q1
{
public static void main (String [] args)
{
for(int number = 1; number <= 100; number += 1)
{
System.out.printf("%2d ", number);
if((number%10) == 0)
System.out.println();
}
}
}
"Repeat exercise 1, but this time use two for loops, one nested within the other."
Can someone please give me an example of how to do this?
Any help would be greatly appreciated!
Thanks in advance!