|
|
1.1 ! root 1: #include <stdio.h> ! 2: ! 3: main() ! 4: { ! 5: extern char *gets(); ! 6: extern double modf(), atof(); ! 7: double real, fp, *ip; ! 8: char string[64]; ! 9: ! 10: for (;;) { ! 11: printf("Enter number: "); ! 12: if (gets(string) == 0) ! 13: break; ! 14: ! 15: real = atof(string); ! 16: fp = modf(real,ip); ! 17: printf("%lf is the integral part of %lf\n", ! 18: *ip, real); ! 19: printf("%lf is the fractional part of %lf\n", ! 20: fp, real); ! 21: } ! 22: putchar('\n'); ! 23: } ! 24:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.