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...


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;
}



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here