i have recently started to learn c programming. while learning i came across a problem in which we are supposed to find the product of divisor of numbers of range upto 10^6.
so, plz if someone can give me any direction on this problem.

Member Avatar for iamthwee

Well if you can't calculate those number using your standard compiler use a library such as the GMP etc.

iamthwee is right but if the intention of your tutor is to make you try such things by using programming constructs then you may try using linked list to solve your problem.

iamthwee is right but if the intention of your tutor is to make you try such things by using programming constructs then you may try using linked list to solve your problem.

linked list is a good option but main problem is how to compute divisors for such a large numbers. For numbers upto the range 10^3 we can compute by check all number starting from 2 to [number/2]....


But for number greater then 10^3 complexity increase and acc. to me it is not a good approach .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.