Print all integers from 1 to 19 on one line.
Ready — edit the code above and click Run.
using System;
class Program
{
static void Main()
{
int n = 19;
for (int i = 1; i <= n; i++)
Console.Write(i + (i < n ? " " : ""));
}
}
Try solving on your own first, then reveal the official answer.
Classic warm-up loop.