Question #26225

If a human heart beats on the average of once a second, how many times does the heart beat in a lifetime of n years? (Use 365.25 for days in a year). Write a program to count the number of heart beat.
1

Expert's answer

2013-03-13T10:14:22-0400
#include <stdio.h>
#include <conio.h>
#define DAYS_IN_YEAR 365.25
int main()
{
    int years;
    double days, hours, mins;
    unsigned __int64 NumOfBeats;
    printf("Enter the number of years of lifetime: ");
    scanf_s("%d", &years);
    days = years * DAYS_IN_YEAR;
    hours = days * 24;
    mins = hours * 60;
    NumOfBeats = mins * 60;
    printf("Number of hurt beats: %u", NumOfBeats);
    printf("\nPress any key to exit...");
    _getch();
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS