BSD 4_3_Tahoe release
[unix-history] / usr / src / usr.bin / learn / getnum.c
CommitLineData
87cbc68f 1#ifndef lint
ca67e7b4 2static char sccsid[] = "@(#)getnum.c 1.1 (Berkeley) 6/8/88";
87cbc68f
JK
3#endif not lint
4
5#include <stdio.h>
6
7getnum()
8{
9 int c, n;
10
11 n = 0;
12 while ((c=getchar()) >= '0' && c <= '9')
13 n = n*10 + c - '0';
14 if (c == EOF)
15 return(-1);
16 return(n);
17}