Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute C# Sharp Online

using System;  
public class pnz 
{  
    public static void Main()  
    {
    int num;
    Console.Write("\n\n");
    Console.Write("Check whether a number is positive or negative:\n");
    Console.Write("----------------------------------------------");
    Console.Write("\n\n");
    Console.Write("Input an integer : ");
    num= Convert.ToInt32(Console.ReadLine());
    if (num >= 0)

 Console.WriteLine("{0} is a positive number.\n",num);
    else
        Console.WriteLine("{0} is a negative number. \n", num);
}
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.