need help on a c# console converter

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();


}

}

}
 
L

Lionel LASKE

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

Lionel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top