home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
PROGRAMM
/
CTUTOR.ZIP
/
SOURCE.ZIP
/
SQUARES.C
< prev
next >
Wrap
Text File
|
1985-12-29
|
512b
|
22 lines
main() /* This is the main program */
{
int x,y;
for(x = 0;x <= 7;x++) {
y = squ(x); /* go get the value of x*x */
printf("The square of %d is %d\n",x,y);
}
for (x = 0;x <= 7;++x)
printf("The value of %d is %d\n",x,squ(x));
}
squ(in) /* function to get the value of in squared */
int in;
{
int square;
square = in * in;
return(square); /* This sets squ() = square */
}