Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- /*
- How much do you earn per day calculator by Goran
- */
- int main()
- {
- float earnPerDay, day = 0, earnings = earnPerDay;
- printf("How much do you earn per day? "); // asking user how much money he earns per day.
- scanf(" %f", &earnPerDay); // gets input from user and stores it into float earnPerDay.
- printf("\n"); // prints blank space.
- do{
- printf("Day: %.0f Cash Earned: %.0f \n", day, earnings); // prints earnings for every day in month.
- day++; // increment float day by one.
- earnings += earnPerDay; // earnings float.
- }while(day <= 31); // do code while day is less or equal to 31.
- printf("\n"); // prints blank space.
- system("pause"); // pausing program after executing.
- return 0;
- }
Add Comment
Please, Sign In to add comment