Ejercicio
Char + for
Objetivo
Crear un programa en C# para escribir las letras "B" a "N" (mayúsculas), usando "for"
Código de Ejemplo
using System; // Import the System namespace to use basic classes like Console
class Program // Define the main class of the program
{
static void Main() // The entry point of the program
{
// Loop through the ASCII values of characters 'B' to 'N'
for (char letter = 'B'; letter <= 'N'; letter++) // Start at 'B' and loop until 'N'
{
Console.Write(letter); // Print the current letter
}
Console.WriteLine(); // Move to the next line after printing all letters
}
}