using System; class c1707 { static int factorial(int i) { int temp; if (i==0) return(1); else temp=checked(i*factorial(i-1)); return(temp); } static int Main() { int i=0; int f=0; string line; reinput : try { Console.WriteLine(" Type in an integer"); line=System.Console.ReadLine(); i=int.Parse(line); if (i<0) { Console.WriteLine( " Can't evaluate factorial for negative integers"); goto reinput; } f=factorial(i); } catch(OverflowException e) { Console.WriteLine(" Overflow occurred - Integer too large {0} ",i); goto reinput; } Console.WriteLine(" {0} ",f); return (0); } }