Hexadecimal equivalent using pointer

This program accepts decimal number and then finds the hexadecimal equivalent of it.Variable num is used to accept decimal input.It is then divided by 16 and the remainder is stored in pointer ptr.The quotient obtained after the division is considered as variable num.This process continous until 0 is obtained as quotient.When 0 is obtained as quotient ,the hexadecimal equivalent of the variable num is stored in pointer ptr.

#include < stdio.h >
#include < conio.h > 
#include < alloc.h>

void main()
{
	int num,rem[20],*ptr;
	clrscr();
	printf("\nEnter number:");
	scanf("%d",&num);
	ptr=rem;
	while(num!=0)
	{
		*ptr=num%16;
		num=num/16;
		ptr++;
	}
	ptr--;
	while(ptr>=rem)
	{
		if(*ptr < 10)
			printf("%d",*ptr);
		else
			printf("%c",*ptr+55);
			ptr--;
	}
}