To write all the number from 0 to 10
for (int i = 1; i <= 10; i++)
{
Console.Write($"{i} ");
}
output:
1 2 3 4 5 6 7 8 9 10
To write all the letter of a text
Console.WriteLine("input a text :");
string text = Console.ReadLine();
for (int i = 0; i < text.Length; i++)
{
Console.Write($"{text[i]} ");
}
Comments