C
xxxxxxxxxx
int main() {
char line[150];
int vowels, consonant, digit, space;
vowels = consonant = digit = space = 0;
printf("Enter a line of string: ");
fgets(line, sizeof(line), stdin);
for (int i = 0; line[i] != '\0'; ++i) {
if (line[i] == 'a' || line[i] == 'e' || line[i] == 'i' ||
line[i] == 'o' || line[i] == 'u' || line[i] == 'A' ||
line[i] == 'E' || line[i] == 'I' || line[i] == 'O' ||
line[i] == 'U') {
++vowels;
} else if ((line[i] >= 'a' && line[i] <= 'z') || (line[i] >= 'A' && line[i] <= 'Z')) {
++consonant;
} else if (line[i] >= '0' && line[i] <= '9') {
++digit;
} else if (line[i] == ' ') {
++space;
}
}
printf("Vowels: %d", vowels);
printf("\nConsonants: %d", consonant);
printf("\nDigits: %d", digit);
printf("\nWhite spaces: %d", space);
return 0;
}
Enter a line of string: adfslkj34 34lkj343 34lk Vowels: 1 Consonants: 11 Digits: 9 White spaces: 2
Linux - anc-api-tools እንዴት እንደሚጫን
Linux - curvedns እንዴት እንደሚጫን
Linux - zenmap እንዴት እንደሚጫን
Python - ቁጥሩ አዎንታዊ፣ አሉታዊ ወይም 0 መሆኑን ያረጋግጡ
C - በአንድ ኢንቲጀር ውስጥ የአሃዞች ብዛት ይቁጠሩ
C - ተለዋዋጭ ማህደረ ትውስታ ምደባን በመጠቀም ትልቁን ቁጥር ያግኙ
Python - የ Excel (XLSX) ፋይሎችን መፃፍ
C++ - ቁጥሩ ዋና መሆኑን ወይም አለመሆኑን ያረጋግጡ
Kotlin - ቁጥር ይገለበጥ
Kotlin - የቁጥር ፋክተርን ያግኙ
JavaScript - ሕብረቁምፊው የሚጀምረው እና የሚያልቅ በተወሰኑ ቁምፊዎች መሆኑን ያረጋግጡ
Linux - zstd እንዴት እንደሚጫን
Linux - xbitmaps እንዴት እንደሚጫን
C++ - Quotient እና Remainderን ያግኙ
Python - የአረፋ ደርድር
Java - ቁጥር ይገለበጥ
C++ - የሊፕ ዓመትን ያረጋግጡ
Kotlin - አንድ ቁጥር ወደ n የአስርዮሽ ቦታዎች ክብ
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month