Lab Program 4
Lab Program 4
Program-4:
Read a multi-digit number (as chars) from the console. Develop a program to print
the frequency of each digit with suitable message.
if count>0:
print(i,"\t",count)
Explanation:
1. The program reads multi digit number. (i.e. 234512, 3424567, 892313..)
2. It then divide the number by 10 to process individual digit.
3. Then it will check its appearance that how many times it appears in the given number.
Output – 1:
Enter any Number 234523
Digit Frequency
2 2
3 2
4 1
5 1
Output – 2:
Enter any Number 352453
Digit Frequency
2 1
3 2
4 1
5 2