You got answers, but ignored them!
Compile This, and note the changes.
And Study a book on C!
Code:
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <conio.c>
#define YEAR 365
#define MONTH 30
int main()
{
char cyear[20], cmonth[20], cday[20];
float outstand, year1, month1, day1, year2,
month2, day2, balyear, balmonth, balday, totaldays, interestowing, total;
///float peryear,permonth,perday; // <---Never Used!
do{
clrscr(); // <-- Defined in conio.c
printf("\n Enter the Date Today(year,month,day): \n\n\n");
scanf("%s %s %s",cyear,cmonth,cday); // or: scanf("%s %s %s",&cyear[0], &cmonth[0], &cday[0]);
year1 = atoi(cyear);
month1 = atoi(cmonth);
day1 = atoi(cday);
printf("\n Enter the date it was due(year,month,day):\n\n\n");
scanf("%s %s %s",cyear,cmonth,cday); // <--------------Reuse your strings!
year2 = atoi(cyear);
month2 = atoi(cmonth);
day2 = atoi(cday);
if(year1 < year2)
{
printf("\n The Due Date Is Later Than Today's Date! You Must Start Over!\n\n ");
continue; // <--- Goes back to beginning of "do/while" loop...
}
else
printf("\n Please Enter the outstanding balance:");
scanf("%f",&outstand); //<-- Must use "&"!!
balyear = year1 - year2;
balmonth = month1 - month2;
balday = day1 - day2;
totaldays = (balyear * YEAR) + (balmonth * MONTH) + (balday);
interestowing = totaldays * 0.12; //12 percent interest (PER DAY!... Are you sure?)
total = outstand + (outstand * interestowing);
printf("\nThe total late charge is: %.2f",interestowing);
printf("\nThe New Total is: %.2f", total);
printf("Press 1 To Do This Again, 0 To Exit...\n\n\n");
int choice;
scanf("%i", &choice);
}while(choice); // <---Same as "}while(choice == 1);"
} //<---The End