Basic Programs

If Else based Programs

Loop Based Programs

Array Based Programs

String Programs

Function Programs

Pointers Programs

Structure & File Handling Programs

Data Structure Programs

String based programs

Find length of string and count vowel in string

#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,count=0;
char str[80];
printf("enter the string");
gets(str);
while(str[i]!=NULL)
{
if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
{
count++;
}
i++;
}
printf("string length=%d no of vowels=%d",i,count);
}

Output of the above program is as following.

Video/ C Introduction

Watch video in full size
Wordpress Social Share Plugin powered by Ultimatelysocial