Check if a given number is Pronic | Efficient Approach | function to check Pronic Number ; Checking Pronic Number by multiplying consecutive numbers ; Driver Code
< ? php function pronic_check ( $ n ) { $ x = floor ( sqrt ( $ n ) ) ; if ( $ x * ( $ x + 1 ) == $ n ) return true ; else return false ; } $ n = 56 ; if ( pronic_check ( $ n ) == true ) echo " YES " ; else echo " NO " ; ? >