title: Assigning an integer value to unsigned char
body: <p>Trying to understand, but I am not able to get the perfect answer.</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main(){
  
      unsigned char ch = '150';
      int count=0;//just to get a count for the loop
      cout &lt;&lt; (int)ch&lt;&lt;endl;
      for (int i = 0; i &lt;= ch * 2; i++){
          cout &lt;&lt; "Hello" &lt;&lt; endl;
          count++;
      }
      cout &lt;&lt; count;
  
      return 0;
  }
  </code></pre>
  
  <p>When I am assigning:</p>
  
  <pre><code>unsigned char ch = '250';
  </code></pre>
  
  <p>If is printing the same output. What I am understanding from the output is that, it is taking the last index of number i.e 0, and from the ASCII lookup table giving me the integer value as 48 for</p>
  
  <pre><code>unsigned char ch = '186';
  </code></pre>
  
  <p>Gives me the integer value as 54,(Which is the ASCII value of number 6) </p>
  
  <pre><code>unsigned char ch = '154';
  </code></pre>
  
  <p>Gives me the integer value as 52, (Which is the ASCII value of number 2)</p>
  
  <p>Is my understanding correct? and will this be applicable for any number assigned to unsigned char in single quote?<a href="https://i.stack.imgur.com/VqVsb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VqVsb.png" alt="I have attached the screenshot of the Ascii look up table"></a>.</p>
  
  <p>I am not getting any error or warnings.<a href="https://i.stack.imgur.com/QiDOh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QiDOh.png" alt="No error in the compiler"></a></p>