Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i,num, counter = 0, min = 7;
- Random r = new Random();
- for (i = 0; i < 50; i++)
- {
- num = r.Next(1, 7);
- if (num == 6)
- counter++;
- min = Math.Min(min, num);
- }
- Console.WriteLine("Number 6 appeared " + counter + " times, minimum number is: " + min);
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment