using System;
class t2
{
public static void Main()
{
double x=double.Parse(Console.ReadLine());
double y=double.Parse(Console.ReadLine());
if (x%5==0)
if (x>y)
if (y-x<0.5)
Console.WriteLine((y-x)-0.5);
else Console.WriteLine(y);
}
}
the error is the way u take the input…the two numbers are in the same line…
eg…
300 120.00
now when u do…
Console.ReadLine()
the input that is taken is the whole line…i.e…
300 120.00
now when u do…
double.Parse();
it gives a number format exception as there is a space in the string…so before doing double.Parse() u need to split the input according to the space…i.e.