Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main()
- {
- Console.Write("Enter the start of the interval: ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("Enter the end of the interval: ");
- int b = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter the number which you would like the interval to be divided with: ");
- int n = int.Parse(Console.ReadLine());
- if (a < 0 || b < 0)
- {
- Console.WriteLine("Enter positive numbers!");
- }
- else if (n == 0)
- {
- Console.WriteLine("p = 0");
- Console.WriteLine("-");
- }
- else
- {
- Console.WriteLine();
- for (int i = a; i <= b; i++)
- {
- if (i % n == 0)
- {
- Console.Write(i + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement