449,886 views
43 votes
43 votes
Write a pseudocode to calculate the factorial of a number

User JoeBobs
by
2.6k points

1 Answer

16 votes
16 votes

Answer:

Answer CODE from C# Sharp Language

Step-by-step explanation:

using System;

namespace test

{

class Program

{

public void silnia()

{

decimal liczba;

decimal silnia = 1;

Console.WriteLine("Obliczanie Silni ");

Console.WriteLine("Podaj liczbę: ");

liczba = Convert.ToInt32(System.Console.ReadLine());

//liczba = int.Parse(Console.ReadLine());

for (int i = 1; i <= liczba; i++)

silnia *= i;

Console.WriteLine("Wynik Silni Wynosi : " +silnia +" \\ ");

}

static Program ćwiczeniaA;

static void Main(string[] args)

{

ćwiczeniaA = new Program();

ćwiczeniaA.silnia();

Console.WriteLine("Koniec Programu");

System.Console.ReadLine();

}

}

}

User Reaz Murshed
by
2.7k points