Computer scienceProgramming languagesC++Types and data structures

Strings

Correct order

Report a typo

Rearrange the code blocks in the correct order and indent them to create a program that takes a string as input and prints the reverse of the string.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                std::string reversedString = "";
              
                int main() {
              
                #include <iostream>
              
                std::cout << "Reversed string: " << reversedString;
              
                std::cout << "Enter a string: ";
              
                std::getline(std::cin, str);
              
                std::string str;
              
                reversedString = myReverseFunc(str);
              
                }
              
                return 0;
              
___

Create a free account to access the full topic