class Rec
{
public int pattern(int n)
{
if(n>=-4)
return pattern(n-5);
else
return pattern(n+4);
}
public static void main(String args[])
{
int a=16;
Rec ob=new Rec();
System.out.print("16\t"+ob.pattern(a));
}
}
Above is my code which compiles successfully but doesn't give any output.
Aucun commentaire:
Enregistrer un commentaire