title: alphabetic inputs run infinite loop
body: <p>I wrote a function to squire number and try to cover all the input possibilities.</p>
  
  <p>Overall it works fine with numeric input, but it starts a infinite loop of printing statements on screen when I enter alphabetical input.As all we know that inside computer single character like  "A or a or b or B" so on is represented by integers and as i learned from my teacher that we can store single characters into a variable with integer data type. i am not talking about strings which means collection of characters . this program create problem  with single character ! </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  void squire();
  
  int main() {
    squire();
  }
  
  void squire() {
    double num = 1.0, pow = 1.0, Squire_Number = 1.0;
    char ans;
  
    reStart:
      cout &lt;&lt; "please Enter the Number: \n";
      cin &gt;&gt; num;
      cout &lt;&lt; "please enter the nmber you want to power the number with: \n";
      cin &gt;&gt; pow;
      if (num &gt; 0 &amp;&amp; pow&gt;0) {
        for (int i = 1; i &lt;= pow; i++) {
          Squire_Number *= num;
          }
          cout &lt;&lt; pow &lt;&lt; " power of " &lt;&lt; num &lt;&lt; " is equil to : " &lt;&lt; Squire_Number;
          goto option;
        }
      else
        {
          cout &lt;&lt; "Please enter Positve Integers. \n" ;
          option:
          cout&lt;&lt; "\nPease type 'Y' to Enter the values again OR type 'c' to Exit ! \n";
          cin &gt;&gt; ans;
          if (ans == 'y' || ans == 'Y') {
            goto reStart;
  
          } else if (ans == 'c' || ans == 'C') {
            cout &lt;&lt; "thank you for using our function. \n";
          }
        }
  
    return;
    }
  </code></pre>