Check if the concatenation of first N natural numbers is divisible by 3 | C # program for the above approach ; Function that returns True if concatenation of first N natural numbers is divisible by 3 ; Check using the formula ; Driver Code ; Given Number ; Function Call
using System ; class GFG { static bool isDivisible ( int N ) { return ( N a 1 ) % 3 != 0 ; } public static void Main ( ) { int N = 6 ; if ( isDivisible ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }