Improved item 1 (1)--function Edition star chart

Source: Internet
Author: User

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: */#include <stdio.h>void printstars (int m)//define the function {int j) that can output a row of M asterisks    ;    for (j=1; j<=m; ++j)         printf ("*");} int main () {  int n=6;//n represents the number of rows to output  int i;  for (I=1; i<=n; ++i)    {        //Please write the statement below that calls the Printstars function, so that the program output is        printstars (i) on the right);        printf ("\ n");    }  return 0;}

Run results


Improved item 1 (1)--function Edition star chart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.