title: what is wrong in this c program?(if else calcus)
body: <p>When this program is build and run in Eclipse, it doesn't run as expected: it doesn't ask me to enter a gender and it runs and quits very quickly.</p>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      char edu,gen;
      int exi;
      float yos;
      printf("This program finds out the salary of an employee\nnow if you are graduate then enter g and if you post graduate then enter pg here :-  ");
      scanf("%c",&amp;edu);
      puts("now enter the yers of service of an employee here :- ");
      scanf("%f",&amp;yos);
      puts("now if you are female then enter f and if you are male then enter m here :- ");
      scanf("%c",&amp;gen);
      puts("salary of an employee is ");
      if(gen=='m' &amp;&amp; edu=='pg' &amp;&amp; yos&gt;=10)
          printf("1500");
      else if(gen=='m' &amp;&amp; edu=='g' &amp;&amp; yos&gt;=10)
          puts("1000");
      else if(gen=='m' &amp;&amp; edu=='pg' &amp;&amp; yos&lt;10)
          puts("10000");
      else if(gen=='m' &amp;&amp; edu=='g' &amp;&amp; yos&lt;10)
          puts("7000");
      else if(gen=='f')
      {
          if(edu=='pg' &amp;&amp; yos&gt;=10)
              puts("12000");
          else if(edu=='g' &amp;&amp; yos&gt;=10 )
              puts("9000");
          else if(yos &lt;10 &amp;&amp; edu=='pg')
              puts("10000");
          else if(edu=='g' &amp;&amp; yos &lt;10)
              puts("6000");
          else
              puts("i dont know!!!!! ");
      }
      puts("\nnow enter any digit to exit\n");
      scanf("%d",&amp;exi);
      printf("you enterd %d , thus good bye",exi);
  
      return 0;
  }
  </code></pre>
  
  <p>output:</p>
  
  <blockquote>
    <p>This program finds out the salary of an employee  now if you are
    graduate then enter g and if you post graduate then enter pg here :- 
    g  now enter the yers of service of an employee here :-   10  now if
    you are female then enter f and if you are male then enter m here :-<br>
    salary of an employee is </p>
    
    <p>now enter any digit to exit</p>
  </blockquote>
  
  <p>Is there a way to fix?</p>