You are on page 1of 1

1 #include<stdio.

h>
2
3 int main()
4 {
5 int group[12];
6 for (int i = 1; i <= 11; i++)
7 {
8 group[i]= 0;
9 }
10 printf("Enter Your data :");
11 for (int i = 1; i <= 10; i++)
12 {
13 int input;
14 scanf("%d",&input);
15 if(input>=0 && input<=9){
16 group[1]++;
17 }else if (input>=10 && input<=19){
18 group[2]++;
19 }else if (input>=20 && input<=29){
20 group[3]++;
21 }else if (input>=30 && input<=39){
22 group[4]++;
23 }else if (input>=40 && input<=49){
24 group[5]++;
25 }else if (input>=50 && input<=59){
26 group[6]++;
27 }else if (input>=60 && input<=69){
28 group[7]++;
29 }else if (input>=70 && input<=79){
30 group[8]++;
31 }else if (input>=80 && input<=89){
32 group[9]++;
33 }else if (input>=90 && input<=99){
34 group[10]++;
35 }else if (input==100){
36 group[11]++;
37 }
38 }
39
40
41 printf("\n");
42 int k = 0;
43 int l = 9;
44 printf("%3s %11s %15s\n","GROUP","RANGE","FREQUENCY");
45 for (int i = 1; i <= 11; i++)
46 {
47 printf("%3d %7d to %3d %7d \n",i,k,l,group[i]);
48 k += 10;
49 l+= 10;
50 if(l>100){
51 l = 100;
52 }
53 }
54
55
56
57 return 0;
58 }

You might also like