-
Notifications
You must be signed in to change notification settings - Fork 0
/
6.5.c
57 lines (53 loc) · 961 Bytes
/
6.5.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include<stdio.h>
int main()
{
int a,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;
scanf("%d",&a);
while (a>0)
{
a++;
int b=a%=10;
if (b==0)
{
f++;
}
if (b==1)
{
g++;
}
if (b==2)
{
h++;
}
if (b==3)
{
j++;
}
if (b==4)
{
k++;
}
if (b==5)
{
l++;
}
if (b==6)
{
m++;
}
if (b==7)
{
n++;
}
if (b==8)
{
o++;
}
if (b==9)
{
p++;
}
}
printf("frequency of digit is\n zero%d\n first%d\n second%d\n third%d\n four%d\n five%d\n six%d\n seven%d\n eight%d\n nine%d\n",f,g,h,j,k,l,m,n,o,p);
return 0;
}