What input is it waiting for? shouldnt scanf read from the printf line above it. I was using all newBalance before and it was doing the same thing. I am new to this and just generally confused with it sometimes.
Take John A's advice and just use one balance variable (e.g. bal and get rid of newBalance)
Remove these lines just before your while loop:
printf("\n");
printf("Enter deposit (+) or Withdrawl (-): ");
scanf("%f", &creditDebit);
You're basically getting all your printfs and scanfs screwed up. Try this for your loop:
while (creditDebit != 0) {
printf("\n");
printf("Enter deposit (+) or Withdrawl (-): ");
scanf("%f", &creditDebit);
bal += creditDebit;
if (bal < 0) {
printf("***I am sorry, you have bounced this check. $10 will be "
"deducted\n");
bal -= 10;
}
printf("Current balance: %.2f\n", bal);
}
In your original code snippet, you were printing the current balance and then calling scanf, whereas you need to print your prompt for credit/debit and then call scanf to achieve the output you require.