Skip to content

Instantly share code, notes, and snippets.

@RenatoRosaFranco
Created July 29, 2014 13:26
Show Gist options
  • Save RenatoRosaFranco/2ec90e1a6f7cca0c7404 to your computer and use it in GitHub Desktop.
Save RenatoRosaFranco/2ec90e1a6f7cca0c7404 to your computer and use it in GitHub Desktop.
Tabuada C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
// Recebe as Variaveis
int formula, contador, numero;
Console.Write("Digite o Numero para Obter a Taboada : ");
numero = Int32.Parse(Console.ReadLine());
//para
for (contador = 1; contador <= 10; ++contador)
{
formula = numero * contador;
Console.WriteLine(numero + " X " + contador + " = " + formula);
}
Console.ReadKey();
}
}
}
@Joicemota99
Copy link

Joicemota99 commented Apr 16, 2022

O meu não vai de jeito nenhum! E eu escrevi o código exatamente assim! kkkk meu deus vou moré

Ele ta indo até o 4 e no final ta assim:
999 X ...

using System;

namespace Uri1078
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
             int formula, contador;
          
              for (contador = 1; contador < 10; ++contador)
            {
                formula =  n * contador;
                Console.WriteLine(n + " X " + contador + " = " + formula);
                
            }

            Console.ReadKey();
        }
    }
}

@vinicius-campelo
Copy link

DECLARE
@i AS INT,
@j AS INT;

SET @I = 1;
SET @J = 1;

WHILE @I <= 10
BEGIN
	SET @J = 1;
	PRINT '';
	WHILE @J <= 10
	BEGIN
		PRINT CONCAT(@I ,'x', @J ,' = ', @I*@J);
		SET @J = @J + 1;
	END
SET @I = @I + 1;
END	

@RenatoRosaFranco
Copy link
Author

RenatoRosaFranco commented Jun 3, 2023

O meu não vai de jeito nenhum! E eu escrevi o código exatamente assim! kkkk meu deus vou moré

Ele ta indo até o 4 e no final ta assim: 999 X ...

using System;

namespace Uri1078
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
             int formula, contador;
          
              for (contador = 1; contador < 10; ++contador)
            {
                formula =  n * contador;
                Console.WriteLine(n + " X " + contador + " = " + formula);
                
            }

            Console.ReadKey();
        }
    }
}

Olá, nossa isso tem muito tempo, era da época do meu técnico em programação,
de qualquer maneira, esta parte do seu código está contador < 10 onde deveria ser contador <= 10,
acredito que você até já resolveu, mas essa mudança, acredito que resolva.

@theyllo
Copy link

theyllo commented Sep 14, 2023

obg por ajudar um formando ]

@RenatoRosaFranco
Copy link
Author

@theyllo Rapaz... feliz que este código ajudou. é mega antigo hehehe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment