-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathq1.c
68 lines (66 loc) · 1.59 KB
/
q1.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
58
59
60
61
62
63
64
65
66
67
68
#include <stdio.h>
int main()
{
int ra1, ra2;
printf("Enter the encrypted code");
scanf("%d", &ra1);
printf("Enter the number of cities");
scanf("%d", &ra2);
char ra3[100];
char ra12[100];
int ra4 = 0, ra5 = 0, ra6 = 0, ra7 = 0, ra8 = 0;
for (int x = 0; x < ra2; x++)
{
printf("Enter a city name : ");
scanf("%s",&ra3);
int i = 0;
while (ra3[i] != '\0')
{
switch (ra3[i])
{
case 'a':
ra4++;
break;
case 'A':
ra4++;
break;
case 'e':
ra5++;
break;
case 'E':
ra5++;
break;
case 'i':
ra6++;
break;
case 'I':
ra6++;
break;
case 'o':
ra7++;
break;
case 'O':
ra7++;
break;
case 'u':
ra8++;
break;
case 'U':
ra8++;
break;
}
i++;
}
if(ra3[0]=ra4)
if(ra3[1]=ra5)
if(ra3[2]=ra6)
if(ra3[3]=ra7)
if(ra3[4]=ra8)
for(int ra13=0; ra3[ra13]<i; ra13++)
{
ra12[ra13] = ra3[ra13];
}
}
printf("Target city is: %s",ra12);
return 0;
}