Program to generate prime numbers

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
    int i, j, n;
    clrscr();
    printf("Enter the limit : ");
    scanf("%d", &n);
    printf("\nThe prime numbers are :\n\n");
    for (i = 1; i <= n; i++)
    {
        if(i <= 3)
        {
            printf("%d\t", i);
        }
        else
        {
            for (j = 2; j <= i / 2; j++)
            {
                if (i % j == 0)
                goto loop;
            }
            printf("%d\t", i);
            loop : ;
        }
    }
    getch();
}

Output:

Enter the limit : 10
The prime numbers are :
1 2 3 5 7