PSEUDOCODIGO
int n, p = 1, c;PRINT("Introduzca un numero entero");
READ n
for (c = 1; c <= n; c = c + 2)
{
p = p * c;
}
PRINT"El producto de los numeros impares al valor leido es: {0}", p);
FINAL

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EXAMEN_UNIDAD2_CONSOLA
{
class Program
{
static void Main(string[] args)
{
int C,N,P=1;
Console.WriteLine("introduce el valor ");
N = int.Parse(Console.ReadLine());
Console.WriteLine("el producto de los numeros impares es:");
for (C = 1; C<=N; C = C + 2)
{
P=P*C;
}
Console.WriteLine("{0} ",P );
Console.ReadKey();
}
}
}

No hay comentarios:
Publicar un comentario