Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //Write a program that enters from the console a positive integer n and prints all the
- //numbers from 1 to n, on a single line, separated by a space
- class NumbersToN
- {
- static void Main()
- {
- Console.Write("N = ");
- int n = int.Parse(Console.ReadLine());
- for (int i = 1; i <= n; i++)
- {
- Console.Write("{0} ",i);
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement