-1
Guys good night!
I’m writing a code that requires a number to be multiplied by itself 200 times so well, but what I’m not getting is to print 10 values in the same line forming a total of 20 lines per ex:
num = 7
1=7 2=14 3=21.................................................................. 10=70
11=77...........................................................................................................................................................................20=140
199=1393......................................................... 200=1400
Below is the code I got 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;
}
}
Edit the question by adding what you have done so far.
– user28595
Has any response helped solve the problem and can address similar questions from other users? If so, make sure to mark the answer as accepted. To do this just click on the left side of it (below the indicator of up and down votes).
– Sorack