You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 14, 2024. It is now read-only.
int main()
{
char name[15];
int v=0, c=0, i=0; // Initialize i to 0
printf("Enter any string: ");
scanf("%s", name);
// Use a while loop to iterate over the string
while (name[i] != '\0')
{
// Check if the current character is a vowel
if(name[i]=='a' || name[i]=='e' || name[i]=='i' || name[i]=='o' || name[i]=='u')
{
v++; // Increment the vowel count
}
else
{
c++; // Increment the consonant count
}
i++; // Increment the loop variable
}
// Print the counts of vowels and consonants after the loop
printf("The number of vowels in the string: %d\n", v);
printf("The number of consonants in the string: %d\n", c);
https://replit.com/@SanjanaYadav7/Sumc?s=app
The text was updated successfully, but these errors were encountered: