Untitled
public c v1 · immutable#include <stdio.h>#include <math.h>int fibnext();int main(int argc, char **argv){ int fib = 0; int total; while(fib < 1e6) { fib = fibnext(); if(fib%2==0) { total+= fib; printf("Added %d, total is now %d\n", fib, total); } } printf("%d\n",total); return 0;}int fibnext(){ static int a = 1; static int b = 1; static int n = 2; int temp; temp = a; a = b; b += temp; n++; printf("b:%d, n:%d\n", b, n); return b;}