/* $Header:getnum.c 12.0$ */
/* $ACIS:getnum.c 12.0$ */
/* $Source: /ibm/acis/usr/src/usr.lib/learn/C/RCS/getnum.c,v $ */

#ifndef lint
static char *rcsid = "$Header:getnum.c 12.0$";
#endif

#include <stdio.h>

getnum()
{
	int c, n;

	n = 0;
	while ((c=getchar()) >= '0' && c <= '9')
		n = n*10 + c - '0';
	if (c == EOF)
		return(-1);
	return(n);
}
