Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //Write a program that prints all the numbers from 1 to N,
- //that are not divisible by 3 and 7 at the same time.
- class Program
- {
- static void Main()
- {
- Console.Write("Enter a number n [n>1]: ");
- int n = int.Parse(Console.ReadLine());
- for (int i = 1; i <= n; i++)
- {
- if ((i % 3 == 0) & (i % 7 == 0))
- {
- continue;
- }
- Console.WriteLine(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment