You need to start with looking at the basics.
int i=3,j=2,num,rem;
printf("enter the number less than which you need all the prime numbers:");
scanf("d",&num);
If you look at the definition of scanf:
http://www.cplusplus.com/reference/cstdio/scanf/[
^] you will see that "d" is not a vlaid format specifier: it should be "%d":
int i=3,j=2,num,rem;
printf("enter the number less than which you need all the prime numbers:");
scanf("%d",&num);
Now you will get into the loop.