@kunaldude04 Change Line No. 7 to if(a[i] == ‘9’)
Compare a[i] with character 9 instead of digit 9.