• 6 Posts
  • 187 Comments
Joined 11 months ago
cake
Cake day: August 8th, 2023

help-circle

  • jsdz@lemmy.mltoLemmy Shitpost@lemmy.worldI wish
    link
    fedilink
    Interlingua
    arrow-up
    13
    ·
    edit-2
    8 months ago
    int is_even(int n)
    {
        int result = -1;
        char number[8]; //should be enough
        sprintf(number, "%d", n);
    
        // check the number
        // TODO: handle negative numbers
        for (char *p=number; *p; p++)
        {
            if (*p=='0' || *p=='2' || *p=='4' || *p=='6' || *p=='8')
                result = 1;
            else if (*p=='1' || *p=='3' || *p=='5' || *p=='7' || *p=='9')
                result = 0;
            else {
               fprintf(stderr, "Your number is wrong!\n");
               exit(1); 
            }
        }
        return result;
    }
    












  • jsdz@lemmy.mltoLinux@lemmy.mlThe future of Linux
    link
    fedilink
    arrow-up
    21
    ·
    8 months ago

    Well okay, since it’s up to me: Let’s have free software. Fully free Linux on every phone, including all “firmware” which has gotten awfully soft lately. No more proprietary driver blobs for ethernet controllers or cellular modems. No more proprietary DRM modules. No more “smart” consumer goods that come without source code. The free software revolution has gone pretty well in some respects, but we need to finish the job and put an end to all that garbage.