A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d8/dd5/check__factorial_8cpp.html below:

TheAlgorithms/C++: math/check_factorial.cpp File Reference

Loading...

Searching...

No Matches

A simple program to check if the given number is a factorial of some number or not. More...

#include <cassert>
#include <cstdint>
#include <iostream>

Go to the source code of this file.

namespace   math   for assert
bool  math::is_factorial (uint64_t n)   Function to check if the given number is factorial of some number or not.
static void  tests ()   Self-test implementations.
int  main ()   Main function.

A simple program to check if the given number is a factorial of some number or not.

A factorial number is the sum of k! where any value of k is a positive integer. https://www.mathsisfun.com/numbers/factorial.html

Definition in file check_factorial.cpp.

◆ main()

Main function.

Returns
0 on exit

Definition at line 71 of file check_factorial.cpp.

71 {

73 return 0;

74}

static void tests()

Self-test implementations.

◆ tests()

Self-test implementations.

Returns
void

Definition at line 56 of file check_factorial.cpp.

56 {

63

64 std::cout << "All tests have successfully passed!" << std::endl;

65}

bool is_factorial(uint64_t n)

Function to check if the given number is factorial of some number or not.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4