sábado, 24 de octubre de 2009

practica 4.3 grados celsius y faherenheit



imagen


codigo



namespace practica_4._3_consola
{
class Program
{
static void Main(string[] args)
{
double celsius,Fahrenheit;
celsius=-10;
Console.WriteLine("celsius\t\farenheit");
while (celsius <= 60.0) { Fahrenheit=(9.0/5.0)*celsius+32.0; Console.WriteLine("{0}\t\t{1}", celsius,Fahrenheit); celsius = celsius +10; }
Console.ReadKey();






programa en windows



namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
double celsius, fahrenheit;
public Form1()
{
celsius = -10;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("celsius fahrenheit");
while (celsius <= 60.0) { fahrenheit=(9.0/5.0)*celsius+32.0; listBox1.Items.Add(celsius.ToString()+" " + fahrenheit.ToString()); celsius = celsius +10; } } private void button2_Click(object sender, EventArgs e) { Close();

No hay comentarios:

Publicar un comentario