for some reason i keep getting 1245036 as the new credit limit, no matter what I put in. Help?
#include
int main()
{
int employee = 1;
int accountNumber;
int creditBefore;
int currentBalance;
int creditAfter;
while ( employee <= 3 ){
printf( "Enter account number: ");
scanf( "%d", &accountNumber );
printf( "Enter current balance: ");
scanf( "%d", ¤tBalance );
printf( "Enter current credit limit: ");
scanf( "%d", &creditBefore );
creditAfter = creditBefore / 2;
printf( "Your new credit limit is %d\n", &creditAfter );
if ( creditAfter < currentBalance ){
printf( "Current balance exceeds new credit limit.\n" );
}
else{
printf( "Current balance does not exceed new credit limit.\n" );
}
}
return 0;
}
2007-02-05
19:33:06
·
3 answers
·
asked by
bloodyhell1981
1
in
Computers & Internet
➔ Programming & Design