Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
programming, c-language?
Write a program that accepts a astring with maximum string length of 10 characters and displays the number of consonants in the string. (assume that all characters on the string contains letters only.)
i ran out of ideas T_T
1 Answer
- 1 decade agoFavorite Answer
include<stdio.h>
#include<conio.h>
main()
{
int vow=0,con=0,space=0,i;
char name[10];
clrscr();
printf("enter your string");
gets(name);
for(i=0;a[i]!='\0';i++)
{
if((a[i]=='a')||(a[i]=='e')||(a[i]=='i')||(a[i]=='o')||(a[i]=='u')||(a[i]=='A')||a[i]=='E')||(a[i]=='I')||(a[i]=='O')|(a[i]=='U'))
vow++;
else if(a[i]==' ')
space++;
else
con++;
}
printf("\n\n no of consonants in your string is %d",con);
getch();
}
Source(s): i am a trainer