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++ - సంఖ్య ప్రధానమైనదా కాదా అని తనిఖీ చేయండి
C - డైనమిక్ మెమరీ కేటాయింపును ఉపయోగించి అతిపెద్ద సంఖ్యను కనుగొనండి
C++ - లీప్ ఇయర్ని తనిఖీ చేయండి
Kotlin - ఒక సంఖ్యను రివర్స్ చేయండి
JavaScript - స్ట్రింగ్ కొన్ని అక్షరాలతో ప్రారంభమై ముగుస్తుందో లేదో తనిఖీ చేయండి
Linux - zstd ని ఎలా ఇన్స్టాల్ చేయాలి
C++ - కోషెంట్ మరియు రిమైండర్ను కనుగొనండి
Linux - xbitmaps ని ఎలా ఇన్స్టాల్ చేయాలి
Kotlin - ఒక సంఖ్యను n దశాంశ స్థానాలకు రౌండ్ చేయండి
Java - ఒక సంఖ్యను రివర్స్ చేయండి
Kotlin - సంఖ్య యొక్క కారకాన్ని కనుగొనండి
Python - Excel (XLSX) ఫైల్లను వ్రాయడం
Java - పిరమిడ్ మరియు నమూనాను సృష్టించండి
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month