title: Correct output when there are upto 9 digits but wrong when there are 10 digits of mob number variable
body: <p>Output shows correct when the phone number variable is upto 9 digits only but shows some random value for 10 digits. Why is this happening?
  Please help.</p>
  <pre><code>#include&lt;stdio.h&gt;
  typedef struct hotel
  {
      char c_name[20];
      int no_days;
      struct phone_number
      {
          int mob;
          int alt_mob;
      }ph;
      
  }h;
  void read(h*);
  void display(h s);
  int main()
  {
      h h1;
      read(&amp;h1);
      display(h1);
  }
  
  void read(h* s)
  {
      printf(&quot;Enter your name: &quot;);
      scanf(&quot;%s&quot;,&amp;(s-&gt;c_name));
      printf(&quot;Enter the number of days: &quot;);
      scanf(&quot;%d&quot;,&amp;(s-&gt;no_days));
      printf(&quot;Enter the phone number: &quot;);
      scanf(&quot;%d&quot;,&amp;((s-&gt;ph).mob));
      printf(&quot;Enter the alternate number: &quot;);
      scanf(&quot;%d&quot;,&amp;((s-&gt;ph).alt_mob));
  }
  void display(h s)
  {
      printf(&quot;%s %d %d %d&quot;,s.c_name,s.no_days,s.ph.mob,s.ph.alt_mob);
  }
  </code></pre>