Advertisement
Fundamentalen

RandomizeTheNumbers1ToN

Mar 25th, 2014
960
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System;
  2.  
  3. class RandomizeTheNumbers1ToN
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("n = ");
  8.         int n = int.Parse(Console.ReadLine());
  9.  
  10.         Random randomNumbers = new Random();
  11.  
  12.         for (int i = 1; i <= n; i++)
  13.         {
  14.             Console.Write(randomNumbers.Next(1, n + 1) + " ");
  15.         }
  16.  
  17.         Console.WriteLine();
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement