C program to print all Prime Numbers between 1 to n

#include<stdio.h>
int main()
{
	int number, i, j, flag;
	printf("Enter Number: ");
	scanf("%d",&number);

	for(i=2;i<=number;i++)
	{
		flag = 1;

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

		if(flag==1)
		{
			printf("%d ", i);
		}
	}

	return 0;
}

Output

Enter Number: 63
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61