Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class NumbersiIntervalDividableGiven
- {
- static void Main()
- {
- Console.Write("Give a start: ");
- uint start = uint.Parse(Console.ReadLine());
- Console.Write("Give an end: ");
- uint end = uint.Parse(Console.ReadLine());
- int counter = 0;
- uint i = 0;
- if (start != 0 && end != 0)
- {
- for (i = start; i <= end; i++)
- {
- if(i % 5 == 0)
- {
- counter++;
- }
- }
- Console.WriteLine("The numbers dividable by 5 between {0} and {1} is/are {2} : {3}",start,end,counter,i);
- }
- else
- {
- Console.WriteLine("Wrong input!!!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement