IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   C# (https://www.ircforumlari.net/c/)
-   -   C# FONKSİYON İLE FAKTORİYEL BULMA (https://www.ircforumlari.net/c/744026-c-fonksiyon-ile-faktoriyel-bulma.html)

Kaf_Dağı 21 Mart 2016 13:38

C# FONKSİYON İLE FAKTORİYEL BULMA
 
Kod:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication22
{
    class Program
    {
        static int faktoriyel(int a)
        {
            int sonuc = 1;
            for (int i = 1; i <= a; i++)
            {
                sonuc=i * sonuc;
            }
            return sonuc;
        }
 
        static void Main(string[] args)
        {
            Console.WriteLine("Faktöriyeli Hesaplanacak Sayıyı Giriniz = ");
            int a = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("İşlemin Sonucu =" + faktoriyel(a));
            Console.ReadLine();
        }
    }
}



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 04:15.

Powered by vBulletin® Version 3.8.8 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2024 IRCForumlari.Net