luc076.c (1089B)
1 /* 2 * Author : Amit Dutta <amitdutta4255@gmail.com> 3 * Date : 08 Feb 2026 4 * Repo : https://github.com/notamitgamer/bsc 5 * License : MIT License (See the LICENSE file for details) 6 */ 7 8 /* Write a program to count the number of occurrences of any two vowels in succession in a line of text. 9 */ 10 11 /* Let Us C, Chap- 16 (Handling Multiple Strings), Qn No.: A(e) */ 12 13 /* This file is auto-generated by a bot. */ 14 /* This code is not compiled; it is for reference only. */ 15 16 17 #include <stdio.h> 18 #include <string.h> 19 #include <stdlib.h> 20 #include <ctype.h> 21 22 int is_vowel(char c) 23 { 24 c = tolower(c); 25 return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'); 26 } 27 28 int main() 29 { 30 char str[100]; 31 int i, count = 0; 32 33 printf("Enter a line of text: "); 34 gets(str); 35 36 printf("Occurrences found:\n"); 37 for (i = 0; str[i] != '\0'; i++) 38 { 39 if (is_vowel(str[i]) && is_vowel(str[i+1])) 40 { 41 printf("'%c%c' ", str[i], str[i+1]); 42 count++; 43 } 44 } 45 46 printf("\n\nTotal number of successive vowels: %d\n", count); 47 48 return 0; 49 }