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
COverview of C : Miles to Kilometers Converter
<01.10>
#include <stdio.h> #define KMS_PER_MILE 1.609 int main(void) { double miles, kms; printf ("Enter a distance in miles: "); scanf("%lf", &miles); printf("The distance in miles is %.2f.\n", miles); kms = KMS_PER_MILE * miles; printf("That equals %.2f kilometers.\n", kms); return (0); }
Hergestellt in Deutschland / Made in Germany
Enter a distance in miles: 55 The distance in miles is 55.00. That equals 88.50 kilometers. ------------------ (program exited with code: 0) Press any key to continue . . .
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland