title: Scanf("%c %f %d %c") Returning weird values
body: <p>My class assignment asks me to prompt the user to input four variable, char float int char, in one input line.</p>
  
  <p>Here is the entire code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;limits.h&gt;
  #include &lt;math.h&gt;
  
  int main(void){
      char h = 'a';
      char b, c, d, e;
      int m, n, o;
      float y, z, x;
      short shrt = SHRT_MAX;
      double inf = HUGE_VAL;
  
      printf("Program: Data Exercises\n");
  
      printf("%c\n", h);
      printf("%d\n", h);
  
      printf("%d\n", shrt);
  
      printf("%f\n", inf);
  
      printf("Enter char int char float: ");
      scanf("%c %d %c %f", &amp;b, &amp;m, &amp;c, &amp;y);
      printf("You entered: '%c' %d '%c' %.3f \n", b, m, c, y);
  </code></pre>
  
  <p>This section of code is where I am having the issue.</p>
  
  <pre><code>    printf("Enter char float int char: ");
      scanf("%c %f %d %c", &amp;d, &amp;z, &amp;n, &amp;e);
      printf("You entered: '%c' %f %d '%c' \n", d, z, n, e);
  </code></pre>
  
  <p>This part works if I isolate the above section.</p>
  
  <pre><code>    printf("Enter an integer value: ");
      scanf("%d", &amp;o);
      printf("You entered: %15.15d \n", o);
  
      printf("Enter a float value: ");
      scanf("%f", &amp;x);
      printf("You entered: %15.2f \n", x);
  
      return 0;
  }
  </code></pre>
  
  <p>Seeing as I cannot post images due to not having a high enough rep, I will provide a link to a screen-cap of the console when running the program.</p>
  
  <p><img src="https://i.stack.imgur.com/zyXhV.png" alt="enter image description here"></p>
  
  <p>I would really appreciate if someone could explain to me why the program is not working correctly. Thanks in advance.</p>