Check if a large number is divisible by 9 or not | C # program to find if a number is divisible by 9 or not . ; Function to find that number is divisible by 9 or not ; Compute sum of digits ; Check if sum of digits is divisible by 9. ; main function
using System ; class GFG { static bool check ( String str ) { int n = str . Length ; int digitSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) digitSum += ( str [ i ] - '0' ) ; return ( digitSum % 9 == 0 ) ; } public static void Main ( ) { String str = "99333" ; if ( check ( str ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }