boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

00196.c (508B)


      1 #include <stdio.h>
      2 
      3 int fred()
      4 {
      5    printf("fred\n");
      6    return 0;
      7 }
      8 
      9 int joe()
     10 {
     11    printf("joe\n");
     12    return 1;
     13 }
     14 
     15 int main()
     16 {
     17    printf("%d\n", fred() && joe());
     18    printf("%d\n", fred() || joe());
     19    printf("%d\n", joe() && fred());
     20    printf("%d\n", joe() || fred());
     21    printf("%d\n", fred() && (1 + joe()));
     22    printf("%d\n", fred() || (0 + joe()));
     23    printf("%d\n", joe() && (0 + fred()));
     24    printf("%d\n", joe() || (1 + fred()));
     25 
     26    return 0;
     27 }
     28 
     29 /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/