Advertisement
Spocoman

01. Sign of Integer Numbers

Jan 24th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SignОfIntegerNumbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num = int.Parse(Console.ReadLine());
  10.             Print(num);
  11.         }
  12.  
  13.          static void Print(int num)
  14.         {
  15.             if (num > 0)
  16.             {
  17.                 Console.WriteLine($"The number {num} is positive.");
  18.             }
  19.             else if (num < 0)
  20.             {
  21.                 Console.WriteLine($"The number {num} is negative.");
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine("The number 0 is zero.");
  26.             }
  27.         }
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement