I am in my very new to all of this and have started my program but I am having a lot of problems and don't even know if this is close to the right start. Any help would be GREAT!
#include <stdio.h>
#include <string.h>
int main(){
char name[50], root[50], indexchar[50]; EOF;
int i, choice;
int NameLength, FirstVowel;
printf("Want to play a game?\n\n");
printf("1. Play name game\n2. To exit");
scanf("%d", choice);
while(choice == '1'){
printf("\n\nEnter a name");
gets(name);
while(name!= EOF){
NameLength = name.length();
for(i=0; i<NameLength; i++) {
indexchar= name.substr(i,1);
if(indexchar=='a'||indexchar=='e'||indexchar=='i'||indexchar=='o'||indexchar=='u'){
FirstVowel=i;
break;
}/*end if*/
}/*end for*/
root=name.substr(FirstVowel,NameLength-FirstVowel);
printf("\n%s,%s, Bo B%s", name, name, root);
printf("Banana, Fana, Fo F%s", root);
printf("Fee, Fy mo M%s", root);
printf(" %s!", name);
}/*end outer while*/
return 0;
}

New Topic/Question
Reply




MultiQuote






|