public class PerfectNumber
{
public static void main(String[] args)
{
for (int number = 1; number <= 1000; number++)
{
int temp = 0;
for (int i = 1; i <= number / 2; i++)
{
if (number % i == 0)
{
temp += i;
}
}
if (temp == number)
{
System.out.println(number + " is a perfect number");
}
}
}
}
{
public static void main(String[] args)
{
for (int number = 1; number <= 1000; number++)
{
int temp = 0;
for (int i = 1; i <= number / 2; i++)
{
if (number % i == 0)
{
temp += i;
}
}
if (temp == number)
{
System.out.println(number + " is a perfect number");
}
}
}
}
👍3
Forwarded from Aman Raj
👍1
CloudSEK is hiring for SDE Intern - Full Stack
Passout year: 2022/ 2023/ 2024
Qualification: B.E/ B.Tech/ M.Tech/ BCA/ MCA/ MSc(cs)
Salary: ₹ 35k - 45k per month
Apply Now: https://cloudsek.com/openings/?gh_jid=4652466004&gh_src=54f8d5664us
Join us:
https://t.me/teamJavaHyd
WhatsApp: https://chat.whatsapp.com/Enb12e0I9kP6ymo2PT1ewg
Passout year: 2022/ 2023/ 2024
Qualification: B.E/ B.Tech/ M.Tech/ BCA/ MCA/ MSc(cs)
Salary: ₹ 35k - 45k per month
Apply Now: https://cloudsek.com/openings/?gh_jid=4652466004&gh_src=54f8d5664us
Join us:
https://t.me/teamJavaHyd
WhatsApp: https://chat.whatsapp.com/Enb12e0I9kP6ymo2PT1ewg
WhatsApp.com
GREAT JAVA opportunities
WhatsApp Group Invite