title: After processing switch cases, C doesn't read the system() function
body: <p><em>Beginner Alert</em></p>
  <p>I was trying something in <code>C</code> that uses 3 functions and <code>system()</code> function. It also includes a <code>Python</code> file that simulates (alt+tab) with pyautogui. The problem is that
  it somehow passes the <code>system(&quot;clear&quot;)</code> command after finishing <code>switch</code> statement.</p>
  <p>Here's the <code>C</code> Code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  #include &lt;stdlib.h&gt;
  
  int makeSwitch() {
  
    int x;
    printf(&quot;\nType and enter one of them:&quot;);
    printf(&quot;\n\n(1) - (2)&quot;);
    printf(&quot;\n\n&gt; &quot;);
    scanf(&quot;%d&quot;, &amp; x);
  
    int y;
    switch (x) {
  
    case 1:
      printf(&quot;I like 1&quot;);
      y = 1;
      break;
    case 2:
      y = 2;
      printf(&quot;I like 2&quot;);
      break;
  
    default:
      system(&quot;python3 tb.py&quot;);
      y = 3;
      break;
    }
  
    system(&quot;clear&quot;);
  
    return y;
  }
  void makePrint(int b) {
    system(&quot;clear&quot;);
  
    if (b == 1) {
      printf(&quot;I like one\n&quot;);
    } else if (b == 2) {
      printf(&quot;I like two\n&quot;);
    } else if (b == 3) {
      printf(&quot;Hotkey: alt + tab\n&quot;);
    } else {
      printf(&quot;Command not found\n&quot;);
    }
  
  }
  int main() {
  
    int x = makeSwitch();
    makePrint(x);
  
    return 0;
  }
  </code></pre>
  <p>Here's the <code>Python</code> code:</p>
  <pre><code>pyautogui.hotkey(&quot;alt&quot;,&quot;tab&quot;)
  </code></pre>
  <p>Output (1):</p>
  <pre><code>I like 1I like one
  </code></pre>
  <p>Output (2):</p>
  <pre><code>I like 2I like two
  </code></pre>
  <p>Output (y != 1 || y != 2):</p>
  <pre><code>Hotkey: alt + tab
  </code></pre>
  <p>So after <code>default:</code> the <code>system(&quot;clear&quot;)</code> works! I am wondering why.</p>
  <p>My guess is I have to flush something that is keeping space and preventing the <code>system()</code> function to run.</p>
  <p>Thank you for reading.</p>