Find the length of input string

This program is executed from the dos shell.Input is given in the form of parameter.The parameter argv accepts the input and then passes it value to pointer ptr.This pointer calculates the length of the string and displays the output.

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

void main(int argc,char *argv[])
{
	int len;
	char *ptr;	
	clrscr();
	if ( argc != 2)
	{
		printf("\n Invalid arguments ");
		exit(0);
	}
	else
	{
		ptr=argv[1];
		len=0;
		while ( *(ptr+len) != '\0')
		{
			len++;
		}
		printf("\n Length is %d",len);
	}
} // main