-
Notifications
You must be signed in to change notification settings - Fork 0
/
Untitled4.cpp
51 lines (48 loc) · 938 Bytes
/
Untitled4.cpp
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
#include <iostream>
using namespace std;
int main ()
{
char k;
int i,a=0,a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0,a8=0,a9=0;
cout<<"Enter Number ";
cin>>k;
while (k!='.')
{
if (k=='0')
++a;
if (k=='1')
++a1;
if (k=='2')
++a2;
if (k=='3')
++a3;
if (k=='4')
++a4;
if (k=='5')
++a5;
if (k=='6')
++a6;
if (k=='7')
++a7;
if (k=='8')
++a8;
if (k=='9')
++a9;
cin>>k;
}
cout<<"The Number of 0 : "<<a<<endl;
cout<<"The Number of 1 : "<<a1<<endl;
cout<<"The Number of 2 : "<<a2<<endl;
cout<<"The Number of 3 : "<<a3<<endl;
cout<<"The Number of 4 : "<<a4<<endl;
cout<<"The Number of 5 : "<<a5<<endl;
cout<<"The Number of 6 : "<<a6<<endl;
cout<<"The Number of 7 : "<<a7<<endl;
cout<<"The Number of 8 : "<<a8<<endl;
cout<<"The Number of 9 : "<<a9<<endl;
// for (i;i==9;i++)
// {
// cout<<"The Number of "<<i<<a<<endl;
// }
return 0;
}