public class Solution {
public static void main(String[] args) {
//write your code here
int i = 1;
while (i<11){
System.out.print(i);
i++;
System.out.print(" ");
}
}
}
I have this much, but I don't know how to multiply these numbers by a factor. Before this, I put the while loop in a new class, but I would get a lot of errors when I tried to run it. What should I do after this?
package com.codegym.task.task03.task0314;
/*
Multiplication table
*/
public class Solution {
public static void main(String[] args) {
//write your code here
int i = 1;
while (i<11){
System.out.print(i);
i++;
System.out.print(" ");
}
int a = 1;
while (i<11){
System.out.print(a);
i++;
System.out.print(" ");
}
}
}