public int count7(int n) {
int count=0;
if(n==0){
return 0;
}
int num = n % 10;
if(num ==7 ){
count++;
}
n=n/10;
return count+count7(n);
}
int count=0;
if(n==0){
return 0;
}
int num = n % 10;
if(num ==7 ){
count++;
}
n=n/10;
return count+count7(n);
}
No comments:
Post a Comment