Menu
Coddy logo textTech

Check a Number

Lesson 8 of 24 in Coddy's Golang Challenges - Level 1 course.

challenge icon

Challenge

Easy

Write a function to check if a number is abundant, deficient, or perfect. If the number is abundant, print "Abundant"; if the number is perfect, print "Perfect"; if the number is deficient, print "Deficient".

  • "Abundant" if sum_of_divisors is greater than the number.
  • "Perfect" if sum_of_divisors is equal to the number.
  • "Deficient" if sum_of_divisors is less than than the number.

Try it yourself

import "fmt"

func checkNumber( ) {



}

All lessons in Golang Challenges - Level 1