How can I check if vector elements are in order consecutively?
<p>I need to check if in my vector the elements are in order consecutively?</p>

<pre><code>for(i=1; i&lt;=K; i++)
    if(v[i]=v[i+1]-1)
</code></pre>

<p>If the statement would be true I want to return the biggest integer.</p>

<blockquote>
  <p>ex. 4 5 6 7</p>
</blockquote>

<pre><code>7
</code></pre>