// Online Java Compiler
// Use this editor to write, compile and run your Java code online
class HelloWorld {
public static void sqr(int x,int y,int n){
if(n==1){
System.out.print(x);
return;
}
if(n==0){
System.out.print(1);
return;
}
x=x*y;
sqr(x,y,n-1);
}
public static void main(String[] args) {
int n=4;
int x=3;
int y=x;
sqr(x,y,n);
}
}
Is this about code is correct in all test case
New contributor
Sagar Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.