Advertisement
SecretWorker

Untitled

Jan 11th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1.       static void e13()
  2.         {
  3.             Random someRand = new Random();
  4.             int s1, s2, count = 0;
  5.             for (int i = 1; i <= 500; i++)
  6.             {
  7.                 s1 = someRand.Next(6, 10);
  8.                 s2 = someRand.Next(6, 10);
  9.                 if ((s1 + s2) % 2 == 0)
  10.                 {
  11.                     count++;
  12.                 }
  13.             }
  14.             Console.WriteLine(count);
  15.         }
  16. static void e16()
  17.         {
  18.             Console.WriteLine("Choose number");
  19.             int num = int.Parse(Console.ReadLine());
  20.             int multi = num % 10;
  21.             while (num != 0)
  22.             {
  23.                
  24.                 num = num/ 10;
  25.                 if (num == 0)
  26.                 {
  27.                     break;
  28.                 }
  29.                 multi = multi * (num % 10);
  30.             }
  31.             Console.WriteLine(multi);
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement