# Resolved: I couldn’t enter fractional value by my keyboard and catching exception

In this post, we will see how to resolve I couldn’t enter fractional value by my keyboard and catching exception

## Question:

I wrote simple console program to calculate expression but I couldn’t enter fractional data to my values.I dont know where is mistake maybe because I am new in c# but I would be glad if someone could help me. Btw maybe the problem is in double.TryParse() method?
using System;
```namespace ConsoleApp
{
class Program {
public static void Main(string[] args)
{
Console.OutputEncoding = System.Text.Encoding.UTF8;

Console.InputEncoding = System.Text.Encoding.UTF8;

System.Globalization.CultureInfo customCulture =
(System.Globalization.CultureInfo)
customCulture.NumberFormat.NumberDecimalSeparator = ".";

Console.WriteLine("Calculate expression");
double x, y, z, s;
do
{
Console.WriteLine("Enter fractional x = ");
else
{
Console.WriteLine("Error try again!");
}
}
while (true);
do
{
Console.WriteLine("Enter fractional y = ");
else
{
Console.WriteLine("Error try again!");
}
}
while (true);
do
{
Console.WriteLine("Enter fractional z = ");
else
{
Console.WriteLine("Error try again!");
}
}
while (true);
s = Math.Pow(2, -x) * Math.Sqrt(x + Math.Pow(Math.Abs(y), 1 / 4)) * Math.Pow(Math.Exp((x - 1) / Math.Sin(z)), 1 / 3);
Console.WriteLine(\$"Result: s = {s:F3}");
By fractional data, I assume you enter something like `3/4`. If so, you cannot parse it directly. You need to separate out the numerator and denominator and calculate the value.