Advertisement
YavorGrancharov

Interval_of_Numbers

Jun 1st, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Interval_of_Numbers
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var num = int.Parse(Console.ReadLine());
  14.             var num2 = int.Parse(Console.ReadLine());
  15.            
  16.             bool equal = num != num2;
  17.            
  18.             if (num > num2) {
  19.                 for(int i = num2; i <= num; i++) {
  20.                     if(equal == true) {
  21.                         Console.WriteLine(i);
  22.                     }
  23.                 }
  24.             }
  25.             else {
  26.                 for(int i = num; i <= num2; i++) {
  27.                     if(equal == true) {
  28.                         Console.WriteLine(i);
  29.                     }
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement