Easy Tutorial
❮ C Exercise Example4 C Exercise Example96 ❯

C Exercise Example 34

C Language Classic 100 Examples

Title: Practice Function Call.

Program Analysis: None.

Program Source Code:

Example

//  Created by www.tutorialpro.org on 15/11/9.
//  Copyright © 2015 tutorialpro.org. 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!

C Language Classic 100 Examples

❮ C Exercise Example4 C Exercise Example96 ❯