1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//function use loop and multiplication// #include<stdio.h> void sq(int i); int main (void) { int i; printf("i \t j\n - \t -\n"); for(i=1; i<=5; i++) sq(i); return 0; } void sq(int i) { printf("%d \t %d \n", i, i*i); }
1 2 3 4 5 6 7
i j - - 1 1 2 4 3 9 4 16 5 25