title: C programming: character in scanf
body: <p>having problem with scanf character...when running program dont let me enter a character an program when i enter the integer prints the printf and go to last else ...</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define EG 0.23
  #define AG 0.70
  #define TG 0.15
  
  main() {
      int posothta;
      char eidos;
      float poso;
  
      printf("Dwse posothta grammatosimwn: ");
      scanf("%d",&amp;posothta);
      printf("Dwse to eidos grammatoshmou: ");
      scanf("%c",&amp;eidos);
  
      if(eidos=='E' || eidos=='e'){
          poso=posothta*EG;
          printf("To poso pou plirwnoume einai: %f",poso);
      }else if(eidos=='A' || eidos=='a'){
          poso=posothta*AG;
          printf("To poso pou plirwnoume einai: %f",poso);
      }else if(eidos=='T' || eidos=='t'){
          poso=posothta*TG;
          printf("To poso pou plirwnoume einai: %f",poso);
      }else{
          printf("Kapou exei gine kapoio la9os");
      }   
  
      return 0;
  }
  </code></pre>