Skip to content

Instantly share code, notes, and snippets.

@frednora
Created August 18, 2018 21:54
Show Gist options
  • Save frednora/6226ce43c2e854fc9dfdf2f48d32e873 to your computer and use it in GitHub Desktop.
Save frednora/6226ce43c2e854fc9dfdf2f48d32e873 to your computer and use it in GitHub Desktop.
check
#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