title: Input/Output scanset in c
body: <pre><code>#include&lt;stdio.h&gt;
  int main()
  {    
      char str[50]={'\0'};
      scanf("%[A-Z]s",str);  
      printf("%s",str);        
      return 0;
  }
  </code></pre>
  
  <p>1)
  Input:</p>
  
  <blockquote>
    <p>helloWORLD</p>
  </blockquote>
  
  <p>output:</p>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <p>2)
  Input:</p>
  
  <blockquote>
    <p>HELLoworlD</p>
  </blockquote>
  
  <p>output:</p>
  
  <blockquote>
    <p>HELL</p>
  </blockquote>
  
  <p>In output 1, i expected the output as "WORLD" but it didnt give any outout.
  From output 2, i understood that this is working only if the first few characters are in upper case.</p>
  
  <p>Can you please explain how it actually works?</p>