TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
A C++ Program to check whether a pair of numbers is an amicable pair or not. More...
#include <cassert>
#include <iostream>
Go to the source code of this file.
Namespaces | |
namespace | math |
for assert | |
Functions | |
int | math::sum_of_divisor (int num) |
Function to calculate the sum of all the proper divisor of an integer. | |
bool | math::are_amicable (int x, int y) |
Function to check whether the pair is amicable or not. | |
static void | tests () |
Self-test implementations. | |
int | main () |
Main function. | |
A C++ Program to check whether a pair of numbers is an amicable pair or not.
An Amicable Pair is two positive integers such that the sum of the proper divisor for each number is equal to the other number.
Definition in file check_amicable_pair.cpp.
int main | ( | void | ) |
Main function.
Definition at line 81 of file check_amicable_pair.cpp.
|
static |
Self-test implementations.
Definition at line 67 of file check_amicable_pair.cpp.