Untitled

 avatar
unknown
plain_text
a month ago
296 B
1
Indexable
private static bool JeLiSavrsenBroj(int broj)
{
    int provjera = broj / 2;
    int suma = 0;
    for (int i = 1; i <= provjera; i++)
    {
        if (broj % i == 0)
        {
            suma += i;
        }
    }
    if (suma == broj)
    {
        return true;
    }
    else return false;
}
Leave a Comment