Created
January 19, 2012 07:53
-
-
Save NickCarneiro/1638645 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
/*Declare Variables*/ | |
float yrly_income, mthly_exp, savings, percent_savings, vacation, tracker; | |
FILE *vacationptr; | |
/*Create and verify output file*/ | |
vacationptr= fopen ("c07result.txt", "w"); | |
if (vacationptr==NULL) | |
{ | |
printf("The file 'c07result.txt' did not open\n."); | |
} | |
/* Request and retrieve the user intiial yearly income*/ | |
printf("Please input yearly income.\n"); | |
scanf("%f", &yrly_income); | |
while(yrly_income>0){ | |
/*request and retrieve monthly expenses and % to save*/ | |
printf("Please input your monthly expenses and percentage savings desired separated by a space.\n"); | |
scanf("%f,%f",&mthly_exp,&percent_savings); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment