B
B Williams
I have written some code that will take in a string and print out the
reverse, but I also want it to check for upper and lower case and swap them.
Will someone assist me?
include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
#include <algorithm>
using std::reverse;
int main() {
cout << "Enter a string.\n";
string name;
getline(cin, name);
reverse(name.begin(), name.end());
cout << name << '\n';
}
reverse, but I also want it to check for upper and lower case and swap them.
Will someone assist me?
include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
#include <algorithm>
using std::reverse;
int main() {
cout << "Enter a string.\n";
string name;
getline(cin, name);
reverse(name.begin(), name.end());
cout << name << '\n';
}