Tasks and codes
/**copyright (c) 2016,CSDN College *all rights reserved.* file name: lzz.c* Creator: Linzeze * Completion Date: May 8, 2016 * version number: v1.0* Problem Description: This set of exercises is intended to output an asterisk graph by invoking a function, to understand and comprehend the working process of the function, and to implement a specific function for subsequent programming of the custom function. (1) Complete the following procedure, so that the program output asterisks below the asterisk chart: (2) According to the main function of the call to Printchs function, as well as the functional requirements of printchs, write Printchs function, so that the following program can output an asterisk graph: (3) in the above program, Change only one place, output the following graphics * Program input: * Program output: *///call function Printchs output asterisk # # # # # # # # # # # # # # # # # # # # # # # # # # # <stdio.h>//Write the definition of a printchs function that outputs a number Printchs (int N,char ch) { int i; for (i=0;i<n;i++) printf ("%c", ch);} int main () { int n=6;//n represents the number of rows to output int i; By calling the Printchs function in the following loop, output the graph for the right (i=1; i<=n; ++i) { printchs (n-i, '); Printchs (2*i-1, ' * '); printf ("\ n"); } return 0;}Run results
Improved item 1 (2)--function Edition star chart