Problem Statement:-

  Given a positive integer n, find if it can be expressed as xy where y > 1 and x > 0 and x and y both are both integers.

Code:-

import java.util.*;
class expressed_as_x_pow_y{
    public static void main(String[] args){
        System.out.println("Check a number can convert in the form of x pow y");
        System.out.println(".................................................");
        System.out.println("Enter the number to be checked :- ");
        Scanner sc=new Scanner(System.in);
        int x =sc.nextInt();
        System.out.println("Entered number is : "+x );
        for(int i=1;i<x;i++){
            for(int j=1;j<x;j++){
                double y=java.lang.Math.pow(i,j);
                if(y==x){
                    System.out.println(i+" pow "+j+" = "+y);
                }
                
            }
        }
    }
}

Out Put:-

Check a number can convert in the form of x pow y
.................................................
Enter the number to be checked :-
64
Entered number is : 64
2 pow 6 = 64.0
4 pow 3 = 64.0
8 pow 2 = 64.0