jituTechnology

jituTechnology

A program to read a line of text and print the number of vowels using function.

A program to read a line of text and print the number of vowels using function.

Codes
/*A program to read a line of text and print the number of vowels*/
/*Programed by          Jitendra Kr Yadav
                         10116
     22 Mar,2011*/
#include<stdio.h>
#include<conio.h>
void vowel(char strint[]);
main()
{
char string[20];
printf(“Enter any string: “);
gets(string);
vowel(string);
getch();
}
void vowel(char str[])
{
int i,count=0;
for(i=0;str[i]!=’\0′;i++)
if(str[i]==’a’||str[i]==’e’||str[i]==’i’||str[i]==’o’||str[i]==’u’)
count+=1;
printf(“The no of vowels are %d.\n\n”,count);
printf(“Press any key to continue…”);
}
Output
Enter any string: aeroplane
The no of vowels are 5.

Press any key to continue…

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930