user input
5
Required output (using while loop)
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
Code:
while (temp1 <= a) {
while (temp2 <= a) {
temp = temp2 * temp1;
System.out.print(temp + " ");
temp2++;
}
temp1++;
System.out.println();
}
i am taking a as input and try to form that figure but i can't.. please help
forloops? Or your debugger to debug your code? I suspecttemp2should be reset to 1 somewhere.