Count of N digit Numbers whose sum of every K consecutive digits is equal | Set 2 | Java Program to implement the above approach ; Function to count the number of N - digit numbers such that sum of every K consecutive digits are equal ; Print the answer ; Driver Code
class GFG { public static void count ( int n , int k ) { long count = ( long ) ( Math . pow ( 10 , k ) - Math . pow ( 10 , k - 1 ) ) ; System . out . print ( count ) ; } public static void main ( String [ ] args ) { int n = 2 , k = 1 ; count ( n , k ) ; } }