C Exercise Example 34
100 cases of classic C language
Title: Practice function call.
Program Analysis: None.
Source Code:
// Created by www.w3big.com on 15/11/9. // Copyright © 2015年 本教程. All rights reserved. // #include <stdio.h> void hello_world(void) { printf("Hello, world!\n"); } void three_hellos(void) { int counter; for (counter = 1; counter <= 3; counter++) hello_world();/*调用此函数*/ } int main(void) { three_hellos();/*调用此函数*/ }
The above example output is:
Hello, world! Hello, world! Hello, world!