|
Guruh: prg008-2 Bajardi: Davranov Azimjon
|
Sana | 01.12.2023 | Hajmi | 327,85 Kb. | | #109432 |
Bog'liq Davranov Azimjon dasturlash 3
Muhammad Al-Xorazmiy nomidagi
Toshkent axborot texnologiyalari universiteti
3-Mustaqil ish
Dasturlash
Guruh:PRG008-2
Bajardi: Davranov Azimjon
Tekshirdi: Saidov Samandar
#include
#include
using namespace std;
int countVowels(const char* sentence) {
const char* vowels = "aeiouAEIOU";
int vowelCount = 0;
for (int i = 0; i < strlen(sentence); ++i) {
if (strchr(vowels, sentence[i]) != nullptr) {
++vowelCount;
}
}
return vowelCount;
}
int main() {
const int maxInputLength = 100;
char inputSentence[maxInputLength];
cout << "Matn kiriting: ";
cin.getline(inputSentence, maxInputLength);
int result = countVowels(inputSentence);
cout << "Unli xarflar soni: " << result <
return 0;
}
|
| |