C 練習(xí)實(shí)例34
題目:練習(xí)函數(shù)調(diào)用。
程序分析:無(wú)。
程序源代碼:
// Created by hgci.cn on 15/11/9. // Copyright © 2015年 W3Cschool教程. 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();/*調(diào)用此函數(shù)*/ } int main(void) { three_hellos();/*調(diào)用此函數(shù)*/ }
以上實(shí)例輸出結(jié)果為:
Hello, world! Hello, world! Hello, world!
更多建議: