title: How to repeat the string in C++?
body: <p>I have to write a program in which integer value is entered from user and the string has to be displayed that many times. But I am getting errors. </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      int N;
  
      cout &lt;&lt; "Enter N: ";
      cin  &gt;&gt; N;
  
      cout &lt;&lt; string(N, "Well Done");
  
      return 0;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JQjez.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JQjez.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Note:</strong> I am not permitted to use a loop in this assignment.</p>