Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class NumsNotD3and7
- {
- static void Main()
- {
- Console.Title = "Numbers not divisible by 3 and 7";
- Console.Write("Enter number n: ");
- int n = int.Parse(Console.ReadLine());
- for (int i = 1; i <= n; i++)
- {
- if (i % 3 != 0 && i % 7 != 0)
- {
- Console.Write(i + " ");
- }
- }
- Console.WriteLine();
- Main();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement