pseudocodigo.
inicio
int n;
double prom = 0.0;
int total = 0;
int suma = 0;
int suma1 = 0;
do
print"INTRODUCE VALOR NUEMRICO"
Read n
suma = suma + n
total = total + 1
}
while n != 9999
{
prom = (suma) / (total);
}
print "ELPROMEDIO RESULTANTE ES" , prom
}
fin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n;
double prom = 0.0;
int total = 0;
int suma = 0;
int suma1 = 0;
do
{
Console.WriteLine("INTRODUCE VALOR NUEMRICO");
n = int.Parse(Console.ReadLine());
suma = suma + n;
total = total + 1;
}
while (n != 9999);
{
prom = (suma) / (total);
}
Console.WriteLine("ELPROMEDIO RESULTANTE ES : {0}", prom);
Console.ReadKey();
}
}
}
20091124
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario