feat: Add count_of_trailing_ciphers_in_factorial_n (#1543)

* zeroes

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 537cd7e8

* Update count_of_trailing_ciphers_in_factorial_n.cpp

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* clang-format and clang-tidy fixes for a8c85e2d

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
This commit is contained in:
Swastika Gupta
2021-07-29 22:11:52 +05:30
committed by GitHub
parent a6bd936530
commit bd44418731
3 changed files with 103 additions and 4 deletions

View File

@@ -22,11 +22,11 @@ template <typename T>
bool is_prime(T num) {
bool result = true;
if (num <= 1) {
return 0;
return false;
} else if (num == 2) {
return 1;
return true;
} else if ((num & 1) == 0) {
return 0;
return false;
}
if (num >= 3) {
for (T i = 3; (i * i) <= (num); i = (i + 2)) {
@@ -47,7 +47,7 @@ int main() {
assert(is_prime(50) == false);
assert(is_prime(115249) == true);
int num;
int num = 0;
std::cout << "Enter the number to check if it is prime or not" << std::endl;
std::cin >> num;
bool result = is_prime(num);