C program to count number of negative numbers in an array



/*
 * Program to count the number of 
 * 8-bit negative numbers from
 * 0xE000 to 0xEFFF
 *
 * February 5, 1998  Bill Rison
 */

#define START 0xE000
#define END   0xEFFF

main()
{
	int count;
	signed char *ptr;

	count = 0;
	ptr = (signed char *) START;
	do
	{
		if (*ptr < 0)
		{
			count = count + 1;
		}
		ptr = ptr + 1;
	}
	while (ptr <= (signed char *) END);
}