title: can someone please help solving this issue
body: <p>i appeared for a campus placement exam few days ago. then while solving it. I found it quite difficult to solve. And atlast i unable to solve it.
  the question is as follows:
  suppose we input a string of n length. then we have to give second input.that is number of charecters after which space needs to put.
  example input:</p>
  <pre><code>joebiden
  3
  </code></pre>
  <p>expected output</p>
  <pre><code>joe bid en
  </code></pre>
  <p>i code something like this.</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
      string str;
      int space, con1 = 0, con2 = 0, con3 = 0, i = 0;
      cin &gt;&gt; str;
      cin &gt;&gt; space;
      con1 = str.size();
      for (con2 = 0; con2 &lt; con1; con2++) {
          for (con3 = 0; con3 &lt; space; con3++) {
              cout &lt;&lt; str[con2];
              if (con3 &lt; (space - 1)) {
                  con2++;
              }
          }
  
          cout &lt;&lt; &quot; &quot;;
      }
  
      return 0;
  }
  </code></pre>