Advertisement
Fundamentalen

NumbersNotDivisibleBy3And7

Mar 23rd, 2014
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. class NumbersNotDivisibleBy3And7
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("Enter your number: ");
  8.         int number = int.Parse(Console.ReadLine());
  9.  
  10.         for (int i = 1; i <= number; i++)
  11.         {
  12.             if (i % 3 == 0 || i % 7 == 0)
  13.             {
  14.                 continue;
  15.             }
  16.             else
  17.             {
  18.                 Console.Write(i + " ");
  19.             }
  20.         }
  21.  
  22.         Console.WriteLine();
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement