Define a function OutputVals() that takes one string and one integer parameter and outputs the nth character of the string n times (each followed by a newline), where n is indicated by the second parameter. The function should not return any value.
Ex: OutputVals("awesome", 4) outputs
o o o o
Recall string's at() returns a character at the specified position in the string. Ex: myString.at(3)
#include #include using namespace std;/* Your code goes here */int main() { string str; int num; cin >> str >> num; OutputVals(str, num); return 0;}
/* Your code goes here */
int main() { string str; int num;
cin >> str >> num; OutputVals(str, num);
return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here