Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
you could store the answer as a string and use std::reverse (). this will modify the string variable and reverse it. example: #include <string> int main () { \\store answer in a string std::string answer ("TheAnswerHere"); \\reverse it std::reverse(answer.begin(), answer.end()); \\print it now that it is reversed std::cout << "In reverse is:\n" << answer; }
10th Feb 2017, 2:08 PM
Aaron Edmistone
Aaron Edmistone - avatar