{"id":16692,"date":"2021-08-12T09:25:17","date_gmt":"2021-08-12T03:55:17","guid":{"rendered":"https:\/\/python-programs.com\/?p=16692"},"modified":"2021-11-22T18:38:32","modified_gmt":"2021-11-22T13:08:32","slug":"python-program-to-check-sunny-number","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-check-sunny-number\/","title":{"rendered":"Python Program to Check Sunny Number"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Find the Missing Term of any Arithmetic Progression<\/a>
\nSunny Number:<\/strong><\/p>\n

A number is said to be a sunny number if the number next to it is a perfect square. In other words, if N+1 is a perfect square, then N is a sunny number.<\/p>\n

Example :<\/p>\n

Let Given number(N) = 3<\/p>\n

Then N+1= 3+1 = 4 # which is a perfect square.<\/p>\n

Therefore ,the Given number “3” is a Sunny Number<\/strong>.<\/p>\n

some of the examples are 3,8 ,15, 24, 35 ,48 ,63, 80 ,99, 120 etc.<\/p>\n

Given a number, the task is to check whether the given number is a Sunny Number or not.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given number = 3<\/pre>\n

Output:<\/strong><\/p>\n

The given number{ 3 } is Sunny Number<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given number = 122<\/pre>\n

Output:<\/strong><\/p>\n

The given number{ 122 } is not a Sunny Number<\/pre>\n

Program to Check Sunny Number<\/h2>\n

Below are the ways to check whether the given number is a Sunny Number or not.<\/p>\n