Answers for "next perfect squire java"

0

next perfect squire java

public class nextperfectsquare {
    public static void main(String[] args) {
        int a=15;
        int result=isPerfectSquare(a);
        System.out.println(result);
    }
    
    static int isPerfectSquare(int num){
         int square = 0; int i = 0; int result = 0;
         for( i=0;i<num+1;i++){
             System.out.println(i);
             square=i*i;
             if(square>=num){
                 result=square;
                 break;
             }
             
         }

        return result;
        
    }
}
Posted by: Guest on May-29-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language