Search
 
SCRIPT & CODE EXAMPLE
 

C

count number of vowels in a string in c

 #include<stdio.h>
  2 int num_vowels(char*);
  3 void main()
  4 {
  5 char s[10];
  6 int c;
  7 printf("Enter the string...
");
  8 scanf("%s",s);
  9 c=num_vowels(s);
 10 printf("%d",c);
 11 printf("
");
 12 }
 13 int num_vowels(char*s)
 14 {
 15 int c=0;
 16 int i;
 17
 18 for(i=0;s[i]!='';i++)
 19 if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||s[i]=='A'||s[i]=='E'||s[i]=='I'||s[i]=='O'||s[i]=='U')
 20 c++;
 21 return c;
 22 }
 23
 24
 25
 26
 27
 28
~             
Comment

PREVIOUS NEXT
Code Example
C :: if statement c short form 
C :: arduino millis() 
C :: create empty vector in rust 
C :: print bool c 
C :: hi servicenow 
C :: read from a file c 
C :: %d in c 
C :: how to checkout branch from commit id 
C :: connect servo to arduino 
C :: what is system function in c 
C :: how to modulo in c without % 
C :: initialize array in c with 0 
C :: factorial of a number in c 
C :: c convert char to int 
C :: sleep function in c 
C :: epoch time in c 
C :: ** in c 
C :: responsive form bootstrap 4 
C :: how to use malloc in c 
C :: sort names in array in c 
C :: unsigned char c programming 
C :: c program for swapping of two numbers 
C :: pandoc set margins pdf 
C :: C fscanf ignore commas 
C :: algorithm for dequeue 
C :: print the name of a file c 
C :: c program for assignment operator 
C :: owasp 
C :: Number 10 
C :: C++ How to use enums for flags? 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =