Advertisement
callumbinner22

task 2

Nov 6th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Please enter a whole number");
  14.             int num = Convert.ToInt32(Console.ReadLine());
  15.             for (int i = 1; i <= num; i++)
  16.             {
  17.                 if (((i % 3) != 0) || (i % 7) != 0)
  18.                 {
  19.                     Console.WriteLine(i);
  20.                 }
  21.             else
  22.             {
  23.                     Console.WriteLine("Invalid Input!");
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement