fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. /*
  5. * https://w...content-available-to-author-only...s.online/so_you_think_you_know_c.html
  6. */
  7.  
  8. struct S {
  9. int i;
  10. char c;
  11. } s;
  12.  
  13. int one() {
  14. return sizeof(*(&s));
  15. }
  16.  
  17. int two() {
  18. char a = 0;
  19. short int b = 0;
  20. return sizeof(b) == sizeof(a+b);
  21. }
  22.  
  23.  
  24. int three() {
  25. char a = ' ' * 13;
  26. return a;
  27. }
  28.  
  29.  
  30. int four() {
  31. int i = 16;
  32. return (((((i >= i) << i) >> i) <= i));
  33. }
  34.  
  35.  
  36. int five() {
  37. int i = 0;
  38. return i++ + ++i;
  39. }
  40.  
  41. int main(void) {
  42. printf("1:%d\n", one());
  43. printf("2:%d\n", two());
  44. printf("3:%d\n", three());
  45. printf("4:%d\n", four());
  46. printf("5:%d\n", five());
  47. return 0;
  48. }
  49.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
1:8
2:0
3:-96
4:1
5:2