Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ITT you are ignorant of functional programmin

Name: Anonymous 2006-05-13 11:02

HURRRR I HAVE NO EVIDENCE

Name: Anonymous 2008-04-12 19:05

int main(void) {
    int n;        /* The number of fibonacci numbers we will print */
    int i;        /* The index of fibonacci number to be printed next */ 
    int current;  /* The value of the (i)th fibonacci number */
    int next;     /* The value of the (i+1)th fibonacci number */
    int twoaway;  /* The value of the (i+2)th fibonacci number */
 
    printf("How many Fibonacci numbers do you want to compute? ");
    scanf("%d", &n);
    if (n<=0)
       printf("The number should be positive.\n");
    else {
      printf("\n\n\tI \t Fibonacci(I) \n\t=====================\n");
      next = current = 1;
      for (i=1; i<=n; i++) {
 printf("\t%d \t   %d\n", i, current);
 twoaway = current+next;
 current = next;
 next    = twoaway;
      }
    }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List