to get a line of text and count the number of vowels in it
Answers were Sorted based on User's Feedback
Answer / chandra sekhar kommuri
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char st[100];
int i,count=0;
clrscr();
printf("Enter line of text:");
gets(st);
for(i=0;st[i]!='\0';i++)
switch(st[i])
{
case 'a':
case 'A':
case 'e':
case 'E':
case 'i':
case 'I':
case 'o':
case 'O':
case 'u':
case 'U':count++;
}
printf("\n Number of vowels:%d",count);
getch();
}
| Is This Answer Correct ? | 75 Yes | 24 No |
Answer / swe
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char st[100];
int i,count=0;
clrscr();
printf("Enter line of text:");
gets(st);
for(i=0;st[i]!='\0';i++)
{
switch(st[i])
{
case 'a':count++;
break;
case 'A':count++;
break;
case 'e':count++;
break;
case 'E':count++;
break;
case 'i':count++;
break;
case 'I':count++;
break;
case 'o':count++;
break;
case 'O':count++;
break;
case 'u':count++;
break;
case 'U':count++;
break;
}
}
printf("\n Number of vowels:%d",count);
getch();
}
| Is This Answer Correct ? | 32 Yes | 15 No |
Answer / sachin
Write a program to print the size of all the data types supported by C and its range?
| Is This Answer Correct ? | 0 Yes | 0 No |
how do you programme Carrier Sense Multiple Access
What is the difference between single charater constant and string constant?
main() { static char *s[]={"black","white","yellow","voilet"}; char **ptr[]={s+3,s+2,s+1,s}, ***p; p=ptr; **++p; printf("%s",*--*++p+3); }
What is derived datatype in c?
write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};
Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.
write a program in c to find out the sum of digits of a number.but here is a condition that compiler sums the value from left to right....not right to left..
how would a 4*3 array A[4][3] stored in Row Major Order?
What are the scope of static variables?
What are c header files?
The differences between Windows XP and Windows Visa
What is structure pointer in c?