Hi All,

I have written a program that doesn't seem to work and I can't figure out why it's not working. It compiles correctly, but when I run it I get prompted by the first couple of printf statements, as it should, but then the rest of the code doesn't run. Could someone please help me?

Thanks for your help!

Code:
#include <stdio.h>

int main()
{

    /* Declare Array Variables */
    
    float deposits[50] = {0}; 
    float withdrawals[50] = {0};
    char  first_name[20] = {0};

    /* Declare Variables */

    int   num_withdrawals, num_deposits, x;
    float current_balance = {0};
    float start_bal;
    float total_deposits;
    float total_withdrawals;
    float balance;
    
    /* Output initial greeting */

    printf("Welcome to the Milas Banking System.\n\n");

    printf("Please enter your first name: ");
    scanf("%s", first_name);
    fflush(stdin);

    printf("\nHello, %s.\n\n", first_name);

    /* Get Starting Balance */    

    do{

    printf("%s, Please enter your current balance in dollars and cents: "); /* Prompt user for current balance. */
    scanf("%f", &start_bal);
    fflush(stdin);

    if (start_bal < 0)
    printf("Invalid entry. Starting balance must be at least zero!\n\n");

    } while (start_bal > 0); /*END DO WHILE*/

    return start_bal;

    /* end function get starting balance */

    /*START FUNCTION GET NUMBER OF WITHDRAWLS*/

    do{

    printf ("\nEnter the number of withdrawals: ");
    scanf ("%i",&num_withdrawals);
    fflush (stdin);

    if (num_withdrawals < 0 || num_withdrawals > 50)
    printf ("Error: Number of withdrawals must be between zero and 50, please re-enter!\n\n");
    
    } while (num_withdrawals < 0 || num_withdrawals > 50); /* end do-while trap loop */

    return num_withdrawals;

    /* end function number of withdrawls */

    /*START FUNCTION GET NUMBER OF DEPOSITS*/

    do{

    printf ("\nEnter the number of deposits: ");
    scanf ("%i",&num_deposits);
    fflush (stdin);

    if ( num_deposits < 0 || num_deposits > 50)
    printf ("Error: Number of deposits must be between 0 and 50, please re-enter!\n\n");
    
    } while (num_deposits < 0 || num_deposits > 50); /* end do-while trap loop */

    return num_deposits;

    /* end function number of deposits */
    
    /*START FUNCTION GET EACH DEPOSIT*/

    for (x = 1; x <= num_deposits; x++)
    
    do{
        
    printf ("Enter the amount of deposit #%i: ", x);
    scanf ("%f",&deposits[x]);
    fflush (stdin);
    
    if (deposits[x] <= 0)
    printf ("*** Deposit amount must be greater than zero. Please re-enter! ***\n");
    
    } while (deposits[x] <= 0);
    
    total_deposits = total_deposits + deposits[x];
    
    /* end for loop */
    /* end function get each deposit */
    
    /* START FUNCTION GET EACH WITHDRAWL */

    for (x = 1; x <= num_withdrawals; x++)
    
    do{
        
    printf ("Enter the amount of withdrawal #%i: ", x);
    scanf ("%f",&withdrawals[x]);
    fflush (stdin);

    if (withdrawals[x] > current_balance)

    printf ("***Withdrawal amount exceeds current balance.***\n");
    
        else
        if (withdrawals[x] <= 0)
            
    printf ("*** Withdrawal amout must be greater than zero. Please re-enter! ***");
    
    } while (withdrawals[x] > current_balance || withdrawals[x] <= 0); /* end do-while loop */
    
    total_withdrawals = total_withdrawals + withdrawals[x];
    
    /*end function get each withdrawl*/
    
    /*START FUNCTION CHECK BALANCE*/

    balance = current_balance - total_withdrawals + total_deposits;
    
    if (balance == 0)
        
    {
        
    printf ("\n *** Balance is now zero. No more withdrawals can be made at this time. ***\n");
    
    num_withdrawals = x;
    
    /*   break; */
    /*end-if*/
    } /*end for loop*/
    /*end function check balance*/
    /*START FUNCTION CALC AND DISPLAY BALANCE*/

    {
    
    printf ("\n*** Your closing balance is $%.2f, %s*** \n", balance, first_name);
    if (balance >= 5000.00)
        
    printf ("*** Time to invest some money!*** \n\n");
    else if (balance >= 15000.00 && balance <= 49999.99)
        
    printf ("*** Maybe you should consider a CD.*** \n\n");
    else if (balance >= 1000.00 && balance <= 14999.99)
        
    printf ("*** Keep up the good work.*** \n\n");
    
    else
    printf ("*** %s, your balance is getting low!*** \n\n", first_name);
    
    }   /*end-if*/
    
    /*end function calc and display balance*/
    
    /*START FUNCTION DISPLAY BANK RECORD*/

    printf ("     *** Bank Record ***\n");
    
    printf ("\nStarting Balance:$   %13.2f\n\n", current_balance);
    
    for (x = 1; x <= num_deposits; x++)
    
    {
    
    printf ("Deposit #%i:          %13.2f\n", x, deposits[x]);
    
    }
    
    for (x = 1; x <= num_withdrawals; x++)
        
    {
        
    printf ("\nWithdrawal  #%i:      %13.2f", x, withdrawals[x]);
    
    }
    printf ("\n\nEnding Balance is:$  %13.2f\n", balance);
    
    /*end function display bank record*/
    
    getchar(); /* Pause output */

    return (0);

}