study/C_C++/sources/c_and_pointer/chapt2/squares.c

27 lines
312 B
C

#include <stdio.h>
/**
*
* 注释不能嵌套
*
**/
void squares ( int limit )
{
int i; /* loop counter */
/*
* Print table of squares
*/
for (i = 0; i < limit ; i ++)
{
printf("%d %d0", i, i * i);
}
printf("\n");
}
int main()
{
squares(7);
return 0;
}