|
Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
|
Problem 23 solution More...
#include <stdio.h>#include <stdlib.h>#include <time.h>Functions | |
| char | get_perfect_number (unsigned long N) |
| Returns: -1 if N is deficient 1 if N is abundant 0 if N is perfect. | |
| unsigned long | is_abundant (unsigned long N) |
| Is the given number an abundant number (1) or not (0) | |
| unsigned long | get_next_abundant (unsigned long N) |
| Find the next abundant number after N and not including N. | |
| char | is_sum_of_abundant (unsigned long N) |
| check if a given number can be represented as a sum of two abundant numbers. | |
| int | main (int argc, char **argv) |
| Main function. | |
Problem 23 solution
| unsigned long get_next_abundant | ( | unsigned long | N | ) |
Find the next abundant number after N and not including N.
| char get_perfect_number | ( | unsigned long | N | ) |
Returns: -1 if N is deficient 1 if N is abundant 0 if N is perfect.
| unsigned long is_abundant | ( | unsigned long | N | ) |
Is the given number an abundant number (1) or not (0)
| char is_sum_of_abundant | ( | unsigned long | N | ) |
check if a given number can be represented as a sum of two abundant numbers.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Main function.