#include <iostream>
#include <string>
using namespace std;
int main () {
string inputString="";
string outputString="";
cout<<"Enter string: ";
getline(cin,inputString);
int firstIndex=-1;
for (int i = 0;i< inputString.length(); ++i) {
if (tolower(inputString[i]) == 'a' ||
tolower(inputString[i]) == 'e' ||
tolower(inputString[i]) == 'i' ||
tolower(inputString[i]) == 'o' ||
tolower(inputString[i]) == 'u') {
firstIndex=i;
break;
}
}
if(firstIndex!=-1){
for (int i = firstIndex;i< inputString.length(); ++i) {
outputString+=inputString[i];
}
for (int i =0;i<firstIndex; ++i) {
outputString+=inputString[i];
}
}
cout<<"\nUpdated string: "<<outputString<<"\n\n";
system("pause");
return 0;
}
Comments
Leave a comment