The squaring function is quite simple:int square(int x){ return x * x;}Here is a loop and main program to call it:#include int square(int);int main(){ int i; for(i = 1; i <= 10; i = i + 1) printf("%d %d\n", i, square(i)); return 0;}
No comments:
Post a Comment