Important

You are seeing the previous version of the new Alura experience we are preparing for you. Soon, it will get a brand-new visual identity designed to boost your studies!

Solved
(See solution)
2
replies

[Projeto] Resposta - Quantos ímpares foram digitados?

List<int> numeros = new List<int>();

for (int i = 0; i < 10; i++)
{
    Console.Write("Digite um número: ");
    int numero = int.Parse(Console.ReadLine());
    numeros.Add(numero);
}

int qtdImpares = 0;

foreach (int numero in numeros)
{
    if (numero % 2 != 0)
    {
        qtdImpares++;
    }
}

Console.WriteLine($"Você digitou {qtdImpares} números ímpares.");
2 replies
solution!

Boa amigo!

Isso ai!