Advertisement
Krissy

H6_Loops_t1_print1ToN

Dec 8th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. class PrintNumbers1_n
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("Please enter n=");
  8.         int n = int.Parse(Console.ReadLine());
  9.         if (n >= 1)
  10.         {
  11.             for (int i = 1; i <= n; i++)
  12.             {
  13.                 Console.WriteLine(i);
  14.             }
  15.         }
  16.         else
  17.         {
  18.             Console.WriteLine("Wrong input!");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement