Join Regular Classroom : Visit ClassroomTech

Count kth Digit Solution | Codewindow.in

Solution : C\C++ Contains only the function (use predefined main method)

//------------------
//
//Ccodewindow.in

int CountDigitNumbers(int arr[], int n, int k){
    int n1, i,c,count=0;
    for(i=0;i<n;i++){
        c=0;
        
        n1 = arr[i];
        while(n1>10){
            n1=n1/10;
            c++;
            
        }
        if(c==k)
        count++;
        
    }
    return count;
}


//Give your own main function

Follow us

Also Checkout