ellapt

6.2.CheckIfDiv3Or7

Dec 5th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2. class CheckIfDiv3or7
  3. {
  4. static void Main()
  5. {
  6. string strNum;
  7. uint n;
  8. uint i = 1;
  9. do
  10. {
  11. Console.Write("Please, enter an unsigned integer number: ");
  12. }
  13. while (!uint.TryParse(strNum = Console.ReadLine(), out n));
  14. while (i <= n )
  15. {
  16. if (!( i % 3 == 0 && i %7 == 0))
  17. {
  18. Console.WriteLine("Number: {0}", i);
  19. }
  20. i++;
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment