C language outputs the Fibonacci series before the specified number

C language outputs the Fibonacci series before the specified number

int fibonacci_sqe(int n)
{
    int t1 = 0, t2 = 1, nt = 0, n;

    nt = t1 + t2;
    while(nt <= n) {
        printf("%d, ",nt);
        t1 = t2;
        t2 = nt;
        nt = t1 + t2;
    }

    return 0;
}

Comments

Popular posts from this blog

Python Receiving and parse JSON Data via UDP protocol

ubus lua client method and event registration code demo/example