-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Odd and Even Check Functions (#165)
* Add CheckOdd and CheckEven functions * code style improved * code corrected
- Loading branch information
1 parent
c7c83c3
commit e0be0fd
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
/** | ||
* This function checks whether | ||
* the provided integer is even. | ||
* | ||
* @param int $number An integer input | ||
* @return bool whether the number is even or not | ||
*/ | ||
function isEven(int $number): bool | ||
{ | ||
return $number % 2 === 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
/** | ||
* This function checks whether | ||
* the provided integer is odd. | ||
* | ||
* @param int $number An integer input | ||
* @return bool whether the number is odd or not | ||
*/ | ||
function isOdd(int $number): bool | ||
{ | ||
return $number % 2 !== 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters