Write a program to count vowels and consonants in string

Anonymous
.
6mo
A program to count the number of vowels and consonants in a given string.Iterate through each character in the stringCheck if the character is a vowel or consonantIncrement the respective countReturn ...
see more
Anonymous
.
6mo
s=input("enter string")l=len(s)vowels=0cons=0print("length of string",l)for i in s: if i in 'aeiou': vowels=vowels+1 else: cons=cons+1print("vowels in string ",vowels)print("co...
see more
Kirti Priya Maheshwari
.
11mo
#include<stdio.h>int main(){ int i , cc=0,cv=0; char str[]="My Name is Kirti"; for(i=0;i<strlen(str);i++) { str[i] =tolower(str[i]); if( str[i] =='a'...
see more
Add answer anonymously...
Wittybrains Software Technologies Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
55 L+

Reviews

5 L+

Interviews

2 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2023 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Hello, Guest
Contribute to help millions!
Write a review
Share interview
Contribute salary
Add office photos
Add office benefits