Scream
12-05-2000, 12:37 PM
Hi This program is meant to say if there is a vowl in a string. I have just
started it but it dosnt work
what am i doing wrong is the switch wrong do i have to use IFs or what?
Thank You
My Current Code:
#include <stdlib.h>
#include <iostream.h>
#include <fstream.h>
#include <string.h>
int main(void)
{
char string[30];
cout<<"Enter a string
";
cin.getline(string, sizeof(string), '
');
cout<<endl;
int i;
for(i=0; i < strlen(string); i++);
{
switch(string[i])
{
case 'i' : cout<<"Letter I
";
default : cout<<"No Vowls
";
}
}
system("pause");
return 0;
}
started it but it dosnt work
what am i doing wrong is the switch wrong do i have to use IFs or what?
Thank You
My Current Code:
#include <stdlib.h>
#include <iostream.h>
#include <fstream.h>
#include <string.h>
int main(void)
{
char string[30];
cout<<"Enter a string
";
cin.getline(string, sizeof(string), '
');
cout<<endl;
int i;
for(i=0; i < strlen(string); i++);
{
switch(string[i])
{
case 'i' : cout<<"Letter I
";
default : cout<<"No Vowls
";
}
}
system("pause");
return 0;
}