-3
`static void Main(string[] args)
    {
        double celsius, Fahrenheit;
        Convert.ToDouble(Console.ReadLine());
        Console.Write("Enter Fahrenheit temperature : ");
        celsius = (Fahrenheit - 32) * 5 / 9;
        Console.WriteLine();
        Console.WriteLine("\nThe converted Celsius temperature is : " + celsius);
        Console.ReadLine();
      
        }
    }
}`

I tried to different methods but it's seems like it doesn't work. I expect that you could help me and this program will work! thanks

BEMO
  • 17
  • 1
    You are reading the users input, but not assigning it to the Fahrenheit variable – stuartd Jan 29 '23 at 00:32
  • Also that should be the line *after* you ask for it, not the line before – stuartd Jan 29 '23 at 00:35
  • 3
    When you ask for help, a description like _"but it's seems like it doesn't work.'_ isn't a very useful problem statement. Have you tried debugging your code (you should quickly see thar it doesn't really do anything – Flydog57 Jan 29 '23 at 00:46
  • 1
    Your title is meaningless (it doesn't summarise the issue at all), you haven't explained what you're trying to achieve or what happens when you try. Please spend some time in the Help Center to learn how to ask a proper question. – jmcilhinney Jan 29 '23 at 03:27

1 Answers1

1
  1. You're printing the prompt to enter the temperature after reading the input for it with ReadLine.
  2. You never assign the read value to anything.

Try this:

Console.Write("Enter Fahrenheit temperature : ");
var fahrenheit = Convert.ToDouble(Console.ReadLine());  
var celsius = (fahrenheit - 32) * 5 / 9;
tymtam
  • 31,798
  • 8
  • 86
  • 126