Loops: 1. What output does the follwing program fragment produce? int i =1 ; while (i <= 128){ printf("%d\n ", i); i *=2; } 2. Translate the above program fragment into a single for loop 3. Fix the error in the following program fragment if (n%2== 0); printf("n is even\n"); 4. Extra: What is the output of the following program fragment: int i,j; int counter =0; for (i =1 ;i <= 20; i++){ for (j=1; j<=i; j++){ counter++; } } printf ("Counter: %d\n", counter); Could you do what this loop is doing with just one loop? Functions: 5. The following function contains several errors. Fix them double triangle_area(double base, height) double product; { product = base* height; return product /2; } 6.) Write a function num_digits(n) that returns the number of digits in n ( an int) 7.) What will be the output of the following program # include void swap (int a, int b); // 1 // 2 int main(void) // 3 { // 4 int i =1, j =2; // 5 \\Point A // 6 swap(i,j); // 7 printf("i = %d, j = %d\n", i , j);// 8 \\ Point E // 9 return 0; // 10 } // 11 // 12 void swap( int a , int b) // 13 { // 14 \\ Point B //15 int temp = a; // 16 \\ Point C // 17 a = b; // 18 b = temp; // 19 \\ Point D // 20 } // 21 8.) Do the stack diagrams for points A, B, C, D and E above A: Program Counter: The Stack Output ========= ========= --- main B: Program Counter: The Stack Output ========= ========= --- main C: Program Counter: The Stack Output ========= ========= --- main D: Program Counter: The Stack Output ========= ========= --- main E: Program Counter: The Stack Output ========= ========= --- main