C Exercise Example 34

100 Classic C Examples

Title:Practice function calling.

Program analysis:None.

Program source code:

Example

// Created by www.example.com on 15/11/9. // Copyright © 2015 Example. 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();/*Call this function*/ } int main(void) { three_hellos();/*Call this function*/ }

The output of the above example is:

Hello, world!
Hello, world!
Hello, world!

100 Classic C Examples

other extensions