I'm pretty new to C so be gentle, somewhy my code doesn't work, be kind and help my figure it out why it doesn't, also if it's possible to make it shorter without making it too complicated, please help in that too.

```
 main.c

#include <stdio.h>
#include <stdlib.h>
#include "swap.h"
#include "magic.h"

int main(int argc, char *argv[])
{
    int i,j,count;
    int min=atoi(argv[1]);
    int max=atoi(argv[2]);

    if(min>max)
    {
        swap(&min, &max);
    }

    if (min<0)
    {
        min=1;
    }

    if(argc<2 || argc>5){exit(EXIT_FAILURE);}
    else
    {
       magic();
    }

}

```

Magic.c

```
    #include <stdlib.h>
#include <stdio.h>
#include magic.h

magic(char *argv[])
{
    for(i = min; i<=max; i++)
    {

        count = 0;

        for(j=2; j<=i/2; j++)
        {
            if(i%j==0)
            {
                count++;
                break;
            }
        }

        if(count==0 && i!= 1 && i!= 0)
            printf("%d \n",i);
    }

    return 0;
}

```