Advertisement
Viacheslav

Untitled

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