I will post that assertion error also
for this program
please see after this program
import java.io.*;
class cal
{
public int n;
public int fact(int n)
{
if (n==0)
{
return 1;
}
else
{
return fact(n-1)*n;
}
}
}
public class Factorial
{
public static void main(
String[] args)
{
cal c=new cal();
DataInputStream d=new DataInputStream(System.in);
System.out.print("Enter the Value:");
try
{
c.n=Integer.parseInt(d.readLine());
}
catch(IOException ie){System.out.println(ie);}
System.out.println("Factorial: "+ c.fact(c.n));
}
}
I saved the program in jdk1.3.1\bin and I tried to compile..It gives "depreciated API"