Professional Documents
Culture Documents
Introduction To Programming Tutorial Question
Introduction To Programming Tutorial Question
What is function?
What are the purposes of function?
Explain TWO (2) types of function. Give an example.
Explain the following:
i
Function definitions
ii
Function declarations
iii
Function call
With appropriate example.
5
6
7
8
9
10
11
*********
HELLO
*********
HAPPYHAPPYHAPPYHAPPYHAPPYHAPPY
void init(void)
sub_num();
void printhw();
TUTORIAL 07
14 Assume that you have functions print_h, print_i, print_m, and print_o, each of which
draws a large block letter (for example, print_o draws a block letter O). What is the effect of
executing the following main function?
int main(void)
{
print_h();
print_i();
printf(\n\n\n);
print_m();
print_o();
print_m();
return (0);
}
int main(void)
{
nonsense ();
nonsense ();
nonsense ();
return (0);
}
16 What does the following main function do? (see Question 15)
void nonsense(void)
{
printf(* * * * *\n);
printf(*
*\n);
printf(* * * * *\n);
}