1. i= 4,j= 48,k= 40 i= 6,j=240,k= 40 2. x=2,i=1 x=4,i=2 x=6,i=3 bonus: x=i=1 x=6,i=4 x=9,i=6 3. f(2) = 8, f(3) = 15, f(4) = 23, f(5) = 45 4 int f(int k) { if (k==1) return 4; if (k>1 && k%2 == 1) return 2*f(k-1)-1; if (k>1 && k%2 == 0) return f(k-1)+f(k/2); } 4. return the number of decimal digits in a string before the character stop int count2(char a[], int n, char stop) { int i=0, counter=0; if (a[0] == stop ) return 0; do { if (a[i] >= '0' && a[i] <= '9') counter++; i++; }while(i longest) { longest = num; pos = i;} } for (j=0; w[pos][j] != '\0'; j++) printf("%c", w[pos][j]); printf("\n"); // second part, print out each player's name with first name in upper case for (i=0; i<15; i++) { j=0; while (w[i][j] != ' ') { if ('a' <= w[i][j] && w[i][j] <= 'z') printf("%c", w[i][j]-'a'+'A'); else printf("%c", w[i][j]); // assume no other char in name j++; } do { printf("%c", w[i][j]); j++; }while(w[i][j] != '\0'); // perfect case for do-while loop printf("\n"); // new line for the next player } return 0; } 7. int f1(int a[], int n) { int i, cnt; cnt = 0; for (i=0; i 0) cnt++; return cnt; } void f2(int a[], int n, int key, int k) { int i, found=0; for (i=0; ik; i--) a[i] = a[i-1]; a[k] = key; } }