Program that makes the entire table between two numbers I type

Asked

Viewed 65 times

-1

ex 2 4 The program has to do two tabs of 3 and four in Portugol

/*mostra toda a tabuada entre dois numeros digitados
name will
data 22/04/2019*/
programa
{

    funcao inicio()
    {
        inteiro n1,n2,aux,contador=0,total
        escreva("Informe o primeiro numero")
        leia(n1)
        escreva("Informe o segundo numero")
        leia(n2)
        se(n2<n1){
            aux=n2
            n2=n1
            n1=aux
        }
        enquanto(n2>=n1){
            enquanto ( contador<= 10 )  {
                total=n1*contador
                escreva(n1,"x",contador,"=",total,"\n")
                contador=contador+1
            }
        }
    }
}
  • 2

    What you’ve tried to do?

  • 2

    I suggest you explain your difficulty, how far you have come, etc. Otherwise it will seem that you just want someone to do your homework.

  • I already reformulated the question and put what I have already done I have managed to make it show the table but not of all numbers between the first number I typed and the second

  • it only makes the first multiplication of the first number in case n1 and ignores N2

  • It hangs when it arrives at the part while counting < =10 it considers that I finish but is missing the other tables and I am not able to solve

1 answer

0

Failed to increase the value of n1 at the end of the tables. And you’ll need to reset the contador when starting the next number tab.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.