C# Program - Check whether a number is positive or negative | Digital Infotainment

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            Console.Write("Enter a number");
            n = int.Parse(Console.ReadLine());
            if(n<0)
            Console.Write("The of the numbers is negative");
            else
            Console.Write("The of the numbers is positive");
            Console.ReadKey();
        }
    }
}

/*Do leave a comment if you find this useful*/

No comments:

Post a comment