Have a good night!
I'm writing a code that requires a number to be multiplied by itself 200 times so far so good, but what I can not do is print 10 values on the same line for a total of 20 lines, eg
num = 7
1 = 7 2 = 14 3 = 21 ...................................... ... 10 = 70
11 = 77 ............................................ ..... 20 = 140
199 = 1393 ............................................ .200 = 1400
Below is the code that I have achieved so far ...
package tabela;
import java.util.Scanner;
public class Tabela {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
int num , resp;
System.out.println("Digite um número inteiro: ");
num = entrada.nextInt();
for (int cont = 1; cont <=200; cont++ ){
resp = num * cont;
if((cont <=10)||(cont <= 200)){
System.out.print( cont + "=" + resp+"\t" );
}
}int cont = 0;
}
}