VelizarAvramov

02. Sign of Integer Number

Nov 17th, 2018
111
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.  
  3. namespace _02._Sign_of_Integer_Number
  4. {
  5.     class SignOfIntegerNumber
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             printSign(n);
  11.         }
  12.  
  13.         private static void printSign(int n)
  14.         {
  15.             if (n > 0)
  16.             {
  17.                 Console.WriteLine($"The number {n} is positive.");
  18.             }
  19.             else if (n<0)
  20.             {
  21.                 Console.WriteLine($"The number {n} is negative.");
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine($"The number {n} is zero.");
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment