Algorithm of the day #18: Count Total number of zeros from 0 up to n? In one solution set n = 100. #w3Develops #100DaysofCode #Tech #freeCodeCamp #Programming #Algorithms #JavaScript #Code #CodeNewbie #Programming #AlgorithmsDaily
1
5
3
0
0
@AlgorithmsDaily static int count(int num){ int count = 0; int temp, rem; for(int i=num; i>0; i--){ temp = i; while(temp>0){ rem = temp%10; temp = temp/10; if(rem==0) count++; } } return count; }