using System;
class Program
{
static void Main()
{
Console.WriteLine("Enter a Number");
int i = int.Parse(Console.ReadLine());
String msg;
if (i > 0)
msg = "You entered Positive Number";
else if (i < 0)
msg = "You entered Negative Number";
else if (i == 0)
msg = "You entered Zero";
else
msg = "I don't know what you entered";
Console.WriteLine(msg);
Console.ReadKey();
}
}
|
Class Program
Private Shared Sub Main()
Console.WriteLine("Enter a Number")
Dim i As Integer = Integer.Parse(Console.ReadLine())
Dim msg As String
If i > 0 Then
msg = "You entered Positive Number"
ElseIf i < 0 Then
msg = "You entered Negative Number"
ElseIf i = 0 Then
msg = "You entered Zero"
Else
msg = "I don't know what you entered"
End If
Console.WriteLine(msg)
Console.ReadKey()
End Sub
End Class
|