GerganaTsirkova

OddNumRewrite

Jan 26th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace OddNumber
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. for (int i = 1; i <= 10; i++)
  10. {
  11. int n = int.Parse(Console.ReadLine());
  12. n = Math.Abs(n);
  13. if (n % 2 != 0)
  14. {
  15. Console.WriteLine($"The number is: {n}");
  16. break;
  17. }
  18. else
  19. {
  20. Console.WriteLine("Please write an odd number.");
  21. }
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment