need help on a c# console converter

  • Thread starter Thread starter sjaak
  • Start date Start date
S

sjaak

Hi, Im just starting out with C#, I try to make a console application where
the user has to fill in temperature in celsius degrees and gets fahrenheit,
my code sucks ; can anyone help me out with this ? this is my code..

using System;

namespace ConsoleApplication1

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

{

Console.WriteLine("temperatuur celsius");

string Celsius=Console.ReadLine();

int temperatuurcelsius=Int32.Parse(Celsius);

int resultaat= temperatuurcelsius - 32*5/9;

Console.WriteLine();

Console.ReadLine();


}

}

}
 
Replace your last "Console.WriteLine();" by "Console.WriteLine(resultaat);"
and it should works.

Lionel.
 
Back
Top