
| Turbo C - (Basic) Age Calculator |
|
#include <stdio.h> /* Programmed by Harvey Losin */ /* http://www.bikoy.com/harvey */ /* webmaster@bikoy.com */ main() { float years; clrscr(); printf("Enter your age in years: "); scanf("%f",&years); printf ("nYou are %.0f months old", years * 12); printf ("nYou are %.0f weeks old", years * 48); printf ("nYou are %.0f days old", years * 365); printf ("nYou are %.0f hours old", years * 8760); printf ("nYou are %.0f minutes old", years * 525600); getch(); } |