wingman007

ConsoleBeepReadCursorPositonColor

Oct 28th, 2015
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. class HelloCSharp
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Hello C#!");
  8.         Console.BackgroundColor = ConsoleColor.Blue;
  9.         Console.SetCursorPosition(10, 10);
  10.         Console.Write("Please enter your age: "); string text = Console.ReadLine();
  11.         int age = int.Parse(text);
  12.  
  13.         Console.WriteLine("Your age will be {0} after 10 years", age + 10);
  14.  
  15.         Random rand = new Random();
  16.         for (int i = 0; i < 10; i++)
  17.         {
  18.             Console.Beep(rand.Next(40, 15000), rand.Next(100, 1000));
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment