Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created December 12, 2017 08:53
Show Gist options
  • Save kaworu/659a8b953eab94c73f51cae9279f3a95 to your computer and use it in GitHub Desktop.
Save kaworu/659a8b953eab94c73f51cae9279f3a95 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int
main(int argc, char **argv)
{
unsigned char uc = 1;
signed char sc = -1;
unsigned int ui = 1;
signed int si = -1;
unsigned long ul = 1;
signed long sl = -1;
(void)printf("char: %s\n", (sc < uc) ? "yes" : "no");
(void)printf("int: %s\n", (si < ui) ? "yes" : "no");
(void)printf("long: %s\n", (sl < ul) ? "yes" : "no");
return 0;
}
@kaworu
Copy link
Author

kaworu commented Dec 12, 2017

char: yes
int:  no
long: no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment