Interview Question
Country: United States
Interview Type: Written Test
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{int i,k;
char s[100];
gets(s);
k=strlen(s);
for(i=1;i<k;i++)
{ if(s[i]=='A'||s[i]=='E'||s[i]=='I'||s[i]=='O'||s[i]=='U')
{ s[i]=s[i]+32;}
else if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
{ s[i]=s[i]-32;}
}
s[0]=(s[0]>96&&s[0]<123)?(s[0]-32):s[0];
puts(s);
getch();
return 0;
}
Do you mean for rule 2. the first consonant of the word and not the sentence? because arE because ARe
- rdo April 13, 2012