Created
August 18, 2018 21:54
-
-
Save frednora/6226ce43c2e854fc9dfdf2f48d32e873 to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
int check( int num ){ | |
return (int) ( num == 0 ? num : ( num > 0 ? 1 : -1 ) ); | |
//return (num > 0) - (num < 0); | |
}; | |
int main (){ | |
printf("Check!\n"); | |
printf("%d ", check( -8 ) ); | |
return 0; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment