Tisho_Todorov

NumbersInIntervalDividableByGivenNumber

Nov 17th, 2014
157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class NumbersInIntervalDividableByGivenNumber
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Plese enter two integer numbers");
  8.  
  9.         Console.Write("Start = ");
  10.         int a = int.Parse(Console.ReadLine());
  11.         Console.Write("End = ");
  12.         int b = int.Parse(Console.ReadLine());
  13.         int count = 0;
  14.         for (int i = a; i <= b; i++)
  15.         {
  16.             if (i % 5 == 0)
  17.             {
  18.                 count++;
  19.             }
  20.         }
  21.         Console.WriteLine("P = {0}", count);
  22.         Console.Write("Comments = ");
  23.         for (int i = a; i <= b; i++)
  24.         {
  25.             if (i % 5 == 0)
  26.             {
  27.                 Console.Write(i + ", ");
  28.             }  
  29.         }
  30.         Console.WriteLine();
  31.         Console.WriteLine("Thank you for your time");
  32.         Console.Title = "Created by T.Todorov";
  33.     }
  34. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×