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 |
write a program for the normal snake games find in most of the mobiles.
how to construct a simulator keeping the logical boolean gates in c
What is the difference between procedural and declarative language?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); }
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Tell me can the size of an array be declared at runtime?
what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; }
What will be the outcome of the following conditional statement if the value of variable s is 10?
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??
What are two dimensional arrays alternatively called as?