hello..

can u tell me how i can determine if a certain number is a perfect number or not?!

please help me..

thanks.

Just read this wiki. There are three easy methods: sum all the number's proper divisors (those with modulus equal to zero) and check if it matches the number; generate one perfect number after another with the given formula until you go beyond the number; check if the bit pattern corresponds to that of a perfect number (the pattern is given in the wiki too).

that's ok..

but how can i use a mathmatical method in java.
i mean what the header file i should use?

#include <cmath>
for that mathematical functions in C++. However, for any of the three methods, there is no need for any mathematical function, just basic arithmetic operators will do.

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.