FANDOM


#include<iostream.h>

#include<stdio.h>

void main()

{

char a[50];

int x,i,count=0;

cout<<"1)input your name"<<endl;

cout<<"2} count the number of charchter"<<endl;

cout<<"3)number of vowels"<<endl;

cout<<"4)replace all the spaces in a string with '*'"<<endl;

cout<<"5)find the total numbers of vowels in a string"<<endl;

cout<<"enter a choice"<<endl;

cin>>x;

switch(x)

{

case 1:

cout<<"enter the name"<<endl;

gets(a);

cout<<a;

break;

case 2:

cout<<"enter the array"<<endl;

gets(a);

for(i=0;a[i]!='\0';i++);

cout<<i<<endl;

break;

case 3:

cout<<"enter the array"<<endl;

gets(a);

for(i=0;a[i]!='\0';i++)

if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='A'||a[i]=='E'||a[i]=='I'||a[i]=='O'||a[i]=='U')

count++;

cout<<count;

break;

case 4:

cout<<"enter the array"<<endl;

gets(a);

for(i=0;a[i]!='\0';i++)

if(a[i]==' ')

a[i]=='*';

break;

case 5:

cout<<"enter the array"<<endl;

gets(a);

for(i=0;a[i]!='\0';i++)

if(a[i]==' ')

count++;

cout<<count;

break;

default:cout<<"";

break;

}

}

Community content is available under CC-BY-SA unless otherwise noted.