Advertisement
Hristo_B

Loops01

May 26th, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. using System;
  2.  
  3. class NumbersToN
  4. {
  5.     static void Main()
  6.     {
  7.         //Write a program that prints all the numbers from 1 to N.
  8.  
  9.         Console.Write("N = ");
  10.         int n = int.Parse(Console.ReadLine());
  11.  
  12.         for (int i = 1; i <= n; i++)
  13.         {
  14.             Console.WriteLine(i);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement