Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Factorial
- {
- class Project1
- {
- void Main()
- {
- int x,f;
- Console.Write("Enter a positive number : ");
- x=Convert.ToInt32(Console.ReadLine());
- f=x;
- while((x-1)>0){
- f=f*(x-1);
- x--;}
- Console.Write("The factorial is {0}",f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment