Art, asked by Ari114, 7 months ago

6. Write a java program to accept a number and check whether the number is a perfect square
or not.
Sample Input: 49
Sample Output: A perfect square
an​

Answers

Answered by kartiktanwar7717
10

Explanation:

hope it helps you Mark me as the BRAINLIEST ❤️

Attachments:
Answered by kalpana3966
0

Answer:

hope it helps..

Explanation:

import java . io. * ;

class X

{

int n , sq ;

public static void main ( sting args [ ] ) throws IOException

Buffered Reader obj = new Buffered Reader (new Input system Reader ( system , in) ) ;

system . out . println ( " Enter the no. " ) ;

n = Integer . parse Int ( obj. read Line ( ) ) ;

int sq = ( int ) math . sqrt ( n ) ;

If ( sq * sq = = n)

system . out . println ( n + " is a perfect square number ") ;

else

system . out. println ( n + " is not a perfect square number " ) ;

}

}

Similar questions