#include <stdio.h> int old_number; /* previous Fibonacci number */ int current_number; /* current Fibonacci number */ int next_number; /* next number in the series */ main() { /* start things out */ old_number = 1; current_number = 1; (void)printf("1\n"); /* Print first number */ while (current_number < 100) { (void) printf("%d\n", current_number); next_number = current_number + old_number; old_number = current_number; current_number = next_number; } return (0); }
file: /Techref/language/ccpp/cref/CONTRIB/OR_PRACTICAL_C/05_1.c, 0KB, , updated: 1995/2/5 07:13, local time: 2024/11/20 08:13,
3.142.54.83:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://linistepper.com/techref/language/ccpp/cref/CONTRIB/OR_PRACTICAL_C/05_1.c"> language ccpp cref CONTRIB OR_PRACTICAL_C 05_1</A> |
Did you find what you needed? |