Skip to content

Instantly share code, notes, and snippets.

@OPhamster
Created July 30, 2017 14:45
Show Gist options
  • Save OPhamster/a92ad9457a503b0eaff67f8dbd399074 to your computer and use it in GitHub Desktop.
Save OPhamster/a92ad9457a503b0eaff67f8dbd399074 to your computer and use it in GitHub Desktop.
New improved Function for positive integer check
// 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