Find all factors of an integer in C language

Find all factors of an integer in C language

void factor_calc(int v)
{
    int i;

    for(i = 1; i <= v; ++i) {
        if (v % i == 0) {
            printf("%d ",i);
        }
    }
}

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