text: Insolite Numbers | C # implementation for the above approach ; Function to check if a number is an Insolite numbers ; To store sum of squares of digits ; To store product of squares of digits ; extracting digit ; Driver Code ; Function Call
code: using System ; class GFG { static bool isInsolite ( int n ) { int N = n ; int sum = 0 ; int product = 1 ; while ( n != 0 ) { int r = n % 10 ; sum = sum + r * r ; product = product * r * r ; n = n / 10 ; } return ( N % sum == 0 ) && ( N % product == 0 ) ; } public static void Main ( ) { int N = 111 ; if ( isInsolite ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }