So I’m fairly new to C++ and thought I’d have a go with solving some basic problems.
My solution so far
#include <string>
using namespace std;
string multi_table(int number)
{
for(int i{1}; i < 11; i++){
cout << i << " * " << number << " = " << number*i;
if (i != 10){
cout << endl;
}
}
return "";
}
It returns exactly what is expected although there’s still an error? The initial set up threw me off to begin with (the lack of “int main()”, and the returning of an empty string).
I think the instructions want you to return a string with this output instead of sending it to cout. So you will need to build up a string and then return that string. Look at the sample tests: