ellapt

T11.2.TenRandomValues

Jan 25th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. using System;
  2.  
  3. class TenRandomValues
  4. {
  5. static void Main()
  6. {
  7. Console.WriteLine("Generate and print to the console 10 random values in the range [100, 200]:");
  8.  
  9. int[] random=new int[10];
  10.  
  11. Random randGenerator=new Random();
  12.  
  13. for (int i = 0; i < 10; i++)
  14. {
  15. random[i] = randGenerator.Next(100, 200) + 1;
  16. Console.Write("{0}, ",random[i]);
  17. }
  18. Console.WriteLine();
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment