Faktoriyel

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace faktoriyel
{
    class Program
    {
        static void Main(string[] args)
        {
            int carp = 1;
            Console.Write("N sayısını giriniz: ");
            int n = Convert.ToInt32( Console.ReadLine());
            for (int i = n; i >1; i--)
            {
                carp = carp * i;
            }
            Console.WriteLine("sonuç={0}",carp);
        }
    }
}



Yorum Gönder

0 Yorumlar