Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C Exercise 34

C Exercise 34

100 Classic C Language Examples 100 Classic C Language Examples

**Problem:** Practice function calls.

**Analysis:** None.

Program source code:

Example

// Created by www.runoob.com on 15/11/9.

// Copyright (c) 2015 Runoob Tutorial. 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 Language Examples 100 Classic C Language Examples