Created
July 30, 2017 14:45
-
-
Save OPhamster/a92ad9457a503b0eaff67f8dbd399074 to your computer and use it in GitHub Desktop.
New improved Function for positive integer check
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
// check if integer is greater than zero or not | |
// this function returns true when a!=0 ie if (a<0 || a>0) | |
// this is not a good check for positive integers | |
// I realize this is not a good example - but for the sake of argument | |
bool check_if_positive(int a){ | |
if(a>0){ | |
return true; | |
} | |
else{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment