Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int end = int.Parse(Console.ReadLine());
  8.         int start = int.Parse(Console.ReadLine());
  9.         int stop = int.Parse(Console.ReadLine());
  10.  
  11.         string result = "";
  12.  
  13.         for(int i = start; i >= end; i--)
  14.         {
  15.             if(i % 2 == 0 && i % 3 == 0)
  16.             {
  17.                 if(i == stop)
  18.                 {
  19.                     break;
  20.                 }
  21.  
  22.             result = i + " ";
  23.             Console.Write(result);
  24.  
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement