martes, 22 de septiembre de 2009

3.1 celcius a fahrenheit






CODIGO EN CONSOLA:

{
double c, f;
Console.WriteLine("Introduce grados Celcuis");
c=double.Parse(Console.ReadLine());
f = (9.0 / 5.0) * c + 32;
Console.WriteLine("La temperatura en grados Fahrenheit es igual a {0}",f);
Console.ReadKey();



}








CODIGO EN WINDOWS



private void button1_Click(object sender, EventArgs e)
{

c=double.Parse(textBox1.Text);
f = (9.0 / 5.0) * c + 32;
textBox2.Text = f.ToString();

}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
}





No hay comentarios:

Publicar un comentario