i need help witn my c programm
sup guys need alil help with my c programm ..My poor progie is acting kinda weird might be a
programming error by me .. well if the Nbalance is
greater than the limit it should print whats in the if () statment
I used borland C compiler
#include <stdio.h>
int main()
{
int act, cnt;
float balance, Tcharge, Tcredit, limit, Nbalance;
clrscr();
while ( cnt != -1 ) {
printf("\nEnter account number (-1 to end ):");
scanf("%d", &act);
if ( act == -1)
break;
printf("\nEnter beginning balance: ");
scanf("%d", &balance);
printf("\nEnter total charge: ");
scanf("%d", &Tcharge);
printf("\nEnter total credits: ");
scanf("%d", &Tcredit);
printf("\nEnter credit limit: ");
scanf("%d", &limit);
}
if ( Nbalance > limit ){
printf("Acount: %d\n", act);
printf("Credit limit: %d\n", limit);
printf("Balance: %d\n",Nbalance);
Nbalance = balance + Tcharge - Tcredit;
printf("\nCredit Limit Exceeded");
}
getch();
return 0;
}
Hey guys one more thing plz compile it and check my programm if its working properlly that way u will know what wrong with it c ya ...