I get the following exception:
Unhandled Exception: System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Int32.Parse(String s) at weatherApp.Program.Main(String[] args) in C:\Users\decagon\source\repos\weatherApp\Program.cs:line 15 Press any key to continue . . .
Here's my code:
namespace weatherApp
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("what is the Value of Temperature in Celcius? ");
Console.Read();
int temp = int.Parse(Console.ReadLine());
if (temp > 24 && temp <50 )
{
Console.WriteLine("Wear a short and light Cloth");
}
if (temp > 50 && temp < 59)
{
Console.WriteLine("Dont Wear Clothes, Weather is too hot");
}
if (temp > 60 && temp <= 100)
{
Console.WriteLine("You are Dead, because you have reached the boiling point");
}
if (temp < 24)
{
Console.WriteLine("You are also dead!!!!!!!");
}
}
}
}