IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
CSelection Structures ❯ Heart Rate Calculator
<03.05>
/* the heart rate program */ #include <stdio.h> int main (void) { int pulse; /* resting pulse rate for 10 secs */ int rest_heart_rate; /* resting heart rate for 1 minute */ /* Enter your resting pulse rate */ printf("Take your resting pulse for 10 seconds.\n"); printf("Enter your pulse rate and press return > "); scanf("%d", &pulse); /* Calculate resting heart rate for minute */ rest_heart_rate = pulse * 6; printf ("Your resting heart rate is %d.\n", rest_heart_rate); /* Display message based on resting heart rate */ if (rest_heart_rate > 75) printf ("Keep up your exercise program!\n"); else printf ("Your heart is doing well!\n"); return (0); }
Hergestellt in Deutschland / Made in Germany
Take your resting pulse for 10 seconds. Enter your pulse rate and press return > 9 Your resting heart rate is 54. Your heart is doing well!
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland