Convert number to string

This program accepts number n as input and then converts it into string.Every digit is considered and as per the position of the digit calculations are peformed.For eg,if digit 4 is at second position then it is considered as forty.Digits are considered from units place and it gradually moves to largest place i.e. from right to left.

#include < stdio.h >
#include < conio.h > 
void main()
{
	long n,div,n1;
	int flag,d,pos,tot_dig;

	clrscr();
	printf("\n Enter n : ");
	scanf("%ld",& n);
	tot_dig = 0;
	div = 1;
	n1 = n;
	while ( n1 > 9 )
	{
		n1 = n1 / 10;
		div = div * 10;
		tot_dig++;
	} // while
	tot_dig++;
	pos = tot_dig;
	while ( n != 0 )
	{
		d = n / div;
		n = n % div;
		div = div / 10;
		switch(pos)
		{
			case 2:
			case 5: if ( d == 1 )
					flag = 1;
				else
				{
					flag = 0;
					switch(d)
					{
						case 2: printf("twenty ");break;
						case 3: printf("thirty ");break;
						case 4: printf("forty ");break;
						case 5: printf("fifty ");break;
						case 6: printf("sixty ");break;
						case 7: printf("seventy ");break;
						case 8: printf("eighty ");break;
						case 9: printf("ninty ");
					} // switch
				}  // else
				break;
			case 1:
			case 4:	if ( flag == 1 )
					{
						flag = 0;
						switch(d)
						{
							case 0 : printf("ten ");break;
							case 1 : printf("eleven ");break;
							case 2 : printf("twelve ");break;
							case 3 : printf("thirteen ");break;
							case 4 : printf("fourteen ");break;
							case 5 : printf("fifteen ");break;
							case 6 : printf("sixteen ");break;
							case 7 : printf("seventeen ");break;
							case 8 : printf("eighteen ");break;
							case 9 : printf("ninteen ");
						} // switch
					} // if
					else
					{
						switch(d)
						{
							case 1 : printf("one ");break;
							case 2 : printf("two ");break;
							case 3 : printf("three ");break;
							case 4 : printf("four ");break;
							case 5 : printf("five ");break;
							case 6 : printf("six ");break;
							case 7 : printf("seven ");break;
							case 8 : printf("eight ");break;
							case 9 : printf("nine ");
						} // switch
					} // else
					if ( pos == 4 )
						printf("thousand ");
				break;
			case 3:
					if ( d > 0 )
					{
						switch(d)
						{
							case 1 : printf("one ");break;
							case 2 : printf("two ");break;
							case 3 : printf("three ");break;
							case 4 : printf("four ");break;
							case 5 : printf("five ");break;
							case 6 : printf("six ");break;
							case 7 : printf("seven ");break;
							case 8 : printf("eight ");break;
							case 9 : printf("nine ");
						} // switch
						printf("hundred ");
					} //if
				break;
		} // switch
		pos--;
	} // while
	if ( pos == 4 && flag == 0)
		printf("thousand");
	else
	if ( pos == 4 && flag == 1)
		printf("ten thousand");
	if ( pos == 1 && flag == 1 )
		printf("ten ");
} // main