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;
- using System.Threading.Tasks;
- namespace NumbersInIntervalDividableByGivenNumber
- {
- class NumbersInIntervalDividableByGivenNumber
- {
- static void Main()
- {
- Console.WriteLine("Enter first positive number: ");
- uint firstNum = uint.Parse(Console.ReadLine());
- Console.WriteLine("Enter bigger positive number: ");
- uint secondNum = uint.Parse(Console.ReadLine());
- int p = 0;
- for (uint i = firstNum; i <= secondNum; i++)
- {
- if (i % 5 == 0)
- {
- p = p + 1;
- Console.WriteLine();
- Console.Write(i);
- Console.WriteLine();
- }
- }
- Console.WriteLine();
- Console.WriteLine("{0} numbers", p);
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment