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 |
Tell me when would you use a pointer to a function?
In C program, at end of the program we will give as "return 0" and "return 1", what they indicate? Is it mandatory to specify them?
if p is a string contained in a string?
every function has return the value?
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B A A B C C B A A B B A A A
Discuss the function of conditional operator, size of operator and comma operator with examples.
What is #line used for?
main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : printf("A"); break; case 0 : printf("B"); break; default : printf("C"); break; }} while(i<3); }
4 Answers Vector, Vector India,
how to find the kth smallest element in the given list of array elemnts.
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
shorting algorithmS