/* 3 points */ AB int i,j=1; AAB AAAB for(i=1; i<=3; i++){ while(j <= i){ printf("A"); j++; } printf("B\n"); j = 1; } Show the output if the user inputs /* 4 points */ void foo(void); fFtgn int test(int i); AF int main(){ F char ch; 16 int n; D scanf("%c",&ch); while(ch!='n' && ch!='N') { switch(ch) { case 'f': foo(); case 'F': printf("F\n"); break; case 't': case 'T': n = test(4); printf("%d\n", n); break; default: printf("D"); } scanf("%c",&ch); } return 0; } void foo(void) { printf("A"); } int test(int i){ return(i*i); } Question 4 (15 pts): Write a Function that displays a pattern of stars
/* 3 points */ int i,j=1; for(i=1; i<=3; i++){ while(j <= i){ printf("A"); j++; } printf("B\n"); j = 1; } AB AAB AAAB /* 4 points */ void foo(void); int test(int i); int main(){ char ch; int n; scanf("%c",&ch); while(ch!='n' && ch!='N') { switch(ch) { case 'f': foo(); case 'F': printf("F\n"); break; case 't': case 'T': n = test(4); printf("%d\n", n); break; default: printf("D"); } scanf("%c",&ch); } return 0; } void foo(void) { printf("A"); } int test(int i){ return(i*i); } Show the output if the user inputs fFtgn AF F 16 D Question 4 (15 pts): Write a Function that displays a pattern of stars