Computer Science, asked by ranjan79ritesh, 1 year ago

WAP to check and print -Sunny number - n is said to be sunny number if square root of (n+1) is an integer. e.g. 8 is a sunny
number because sq.root of (8+1. )is 3.

Answers

Answered by hannahsabu2005
4

hope it helps you man

Keep goin!

Attachments:
Answered by Puneeth1235
4

Answer:

class SunnyNum

{

   public static void main(int n)

   {

       double res =Math.sqrt(n+1);

       if((int)(res)==res)

       System.out.println(n+"is a sunny number");

       else

       System.out.println(n+"is not a sunny number");

   }

}

Explanation:

Similar questions