Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class NumbersDividableByNumber
- {
- static void Main()
- {
- int startNum = int.Parse(Console.ReadLine());
- int endNum = int.Parse(Console.ReadLine());
- int counter = 0;
- Console.Clear();
- for (int cnt = startNum; cnt <= endNum; cnt++ )
- {
- if(cnt % 5 == 0)
- {
- Console.Write(counter == 0 ? "{0}" : ",{0}", cnt);
- counter++;
- }
- }
- if(counter == 0)
- {
- Console.Write("-");
- }
- Console.WriteLine("\r\nCount: {0} numbers.", counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement