Question #215981

given an input string Ayodhya your C program to count the number of vowels and consonants and print the frequency of occurrence of each vowel and consonant delete the vowels in the same input string and display the updated string
Sample input:
Enter the input string: Ayodhya
Sample output:
No of vowels:3
Frequency of occurrence:A-2;o-1
No of consonants:4
Frequency of occurrence:y-2;d-1;h-1

Expert's answer

print("Enter a string")
s = input()


li = list(s.split(" "))


li = [int(i) for i in li]


li.sort(reverse = True)


list_string = map(str, li)


s = ""
for x in list_string:
    s = s + x + " "
    
print(s)
LATEST TUTORIALS
APPROVED BY CLIENTS