You need to write a C program that reads a user-entered string from the terminal and counts the number of vowels in the string. The string can have spaces.
Arrange the correct order of the C program that will perform the required functionality.
The initial start is given below:
#include <stdio.h>
#include <string.h>
/*line 1 */
/*line 2 */
{
/*line 3 */
/*line 4 */
/*line 5 */
/*line 6 */
{
/*line 7 */
/*line 8 */
}
/*line 9 */
/*line 10 */
|
A. |
|
B. |
printf("Number of vowels: %d\n", i);
|
C. |
if( ((str[i]) == 'a') && ((str[i]) == 'e') && ((str[i]) == 'i') && ((str[i]) == 'o') && ((str[i]) == 'u') )
|
D. |
|
E. |
|
F. |
printf("Number of vowels: %d\n", num_vowels);
|
G. |
|
H. |
|
I. |
|
J. |
if( (tolower(str[i]) == 'a') || (tolower(str[i]) == 'e') || (tolower(str[i]) == 'i') || (tolower(str[i]) == 'o') || (tolower(str[i]) == 'u') )
|
K. |
int i =0, num_vowels = 0, str[101], ch;
|
L. |
printf("Enter a string- maximum length 100: ");
|
M. |
|
N. |
|
O. |
while (i <= strlen(str));
|
P. |
|
Q. |
int i =0, num_vowels = 0; char str[101]; char ch;
|
R. |
|
S. |
|
T. |
for (i=1; i <= strlen(str); i++);
|
|