I want to type a line of character , and from there calculate the vowel , consonant and space .
I tried to run the program , but after typing few random character , the setup stopped working
what's the problem ??
someone please points out my mistakes
thank you !
Code:#include<stdio.h> int main() { char line[150]; int i, v, c, s; v = c = s = 0; printf("Enter a line of character :"); gets(line); for ( i= 0; line != '\0' ; ++i) if (line[i] == 'a' || line[i] == 'e' || line[i] == 'i' || line[i] == 'o' || line[i] == 'u' ) ++i; else if (line[i] >='a' && line[i] <= 'z' ) ++c; else if (line[i] ==' ' ) ++s; printf("vowel = %d \n consonant = %d \n space =%d ", v , c, s ); return 0; }



LinkBack URL
About LinkBacks


