title: c program for a simple ATM machine using if and else if
body: <p>I am not able to figure out where is the mistake. When I am trying to run the program, Its not going pass the choice and its going directly to the end of the program after asking for the choice. And, its also giving some warning in "Show output from build" in visual c++ compiler. Can anyone help me with this, please?</p>
  
  <pre><code>     #include &lt;stdio.h&gt;
       int main ()
       {
       int card_number, choice, withdraw, deposit;
       float amount = 3000.00, new_amount = 0;
       char password;
       printf("Enter the card number: ");
       scanf("%d", &amp;card_number);
       printf("Enter the Password: ");
       scanf(" %c", &amp;password);
       printf("\n\n");
       printf("\n\t***********************************");
       printf("\n\t*           MENU                  *");
       printf("\n\t*     1. Check Balance            *");
       printf("\n\t*     2. Withdraw                 *");
       printf("\n\t*     3. Deposit                  *");
       printf("\n\t*     4. Exit                     *");
       printf("\n\t*                                 *");
       printf("\n\t***********************************");
       printf("\n\n");
       printf("Enter your choice: ");
       scanf("%d", &amp;choice);
  
       if (choice == 1)
         {
        printf("Current balance on your account: %f\n", amount);
         }
       else if (choice == 2)
        {
      printf("Enter the amount you want to withdraw: ");
      scanf("%d", &amp;withdraw);
  
      if (withdraw &gt; amount)
        {
          printf("You don't have sufficient balance");
        }
      else
        {
          new_amount = amount - withdraw;
          printf("Current balance on your account: %f\n", new_amount);
        }
  }
  
  else if (choice == 3)
  {
      printf("Enter the amount you want to deposit: ");
      scanf("%d", &amp;deposit);
      amount = amount + deposit;
      printf("Current balance on your account: %d\n", amount);
  }
  else if (choice == 4)
  {
      printf("Thank you for using our service\n\n");
  }
  
  return 0;
      }
  </code></pre>