Mencari Nilai Faktorial pada C#
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int h;
Console.Write("m!\nMasukkan Nilai N = ");
int n = int.Parse(Console.In.ReadLine());
h = 1;
Console.Write(n + "! =");
for (int i = 1; i <= n; i++)
{ h = h * i;
Console.Write(n-(i-1));
if (i != n)
Console.Write("*");
}
Console.WriteLine();
Console.Write(n+ "!");
Console.Write("=");
Console.WriteLine(h);
Console.ReadLine();
}
}
}
Sabtu, November 12, 2011
|
Label:
C#
|
Langganan:
Posting Komentar (Atom)
Diberdayakan oleh Blogger.
Entri Populer
-
source code ini simple bgt deh,,,hhe.....,,mklum baru bljr.... namespace ConsoleApplication1 { class Program { static...
-
source codenya pasti mantap dah,,,ckckck... namespace ConsoleApplication1 { class Program { static void Main(string[]...
-
source code program persegi bintang pada c++; #include <iostream.h> #include <conio.h> int main() { int ukuran; do ...
Buku Tamu
Arsip Blog
About Me

- Ijal Ferdi
- there is no something special about me,,, but this blog is so special for me......
0 komentar:
Posting Komentar