Exercise
Positive And Negative
Objetive
Write a C# program to get a number and answer whether it is positive or negative.
Example Code
using System;
'Positive and negative
public class exercise15
{
public static void Main()
{
int a;
Console.Write("Enter a number: ");
a = Convert.ToInt32(Console.ReadLine());
if (a > 0)
Console.WriteLine("is positive");
if (a < 0)
Console.WriteLine("is negative");
}
}