- ..clause 1..: Basic knowledge
- ..clause 2..: Program readout
- Memo
- ..clause 4..: Description type
- ..clause 5..: Basic knowledge(example solution)
- ..clause 6..: Program readout(example solution)
- Memo(example solution)
- ..clause 8..: Description type(example solution)
[ 1-1 ]
What is called the declaration of the shape of the function at the head of the program?
[ 1-2 ]
What is called the variable declared to pass the function the numerical value?
[ 1-3 ]
What are called the numerical value and the variable passed to the function?
Example solution
[ 1-4 ]
What is called the numerical value returned from the function?
Example solution
[ 2-1 ]
In the following program, for what is function tri function?
Judging from the content of processing and the variable identifier, answer.
#include <stdio.h> int tri(int,int); int main(void) { int side,high,square; scanf("%d,%d",&side,&high); printf("%d\n",tri(side,high)); return 0; } int tri(int side,int high) { return side * high / 2; }
Example solution
[ 3-1 ]
The Olympics must be held when you input the age at the Christian era or make the displayed program.
However, make the part where holding the Olympics is calculated as another function.
- 2000Age..summer..rally..open..afterwards..winter..summer..winter..summer..order..open..do.
Moreover, this schedule is assumed not to go mad through all eternity.
Example solution
[ 4-1 ]
Explain the function is made concisely probably because of ..what...
[ 1-1 ]
Prototype declaration
[ 1-2 ]
Dummy argument
[ 1-3 ]
Actual argument
Problem
[ 1-4 ]
Return value
Problem
[ 2-1 ]
Function that calculates area of a triangle
Problem
[ 3-1 ]
- oThe return value of the lympic function is associated with holding.#include <stdio.h> int olympic(int year); int main(void) { int year,hold; scanf("%d",&year); hold = olympic(year); switch (hold) { case 0: Printf ("\n not opened"); break; case 1: Printf ("Olympic Summer Games \n"); break; case 2: Printf ("Olympic Winter Games \n"); break; }; return 0; } int olympic(int year) { if (year % 2 == 0) { if (year % 4 == 0) { return 1; } else { return 2; } } else { return 0; } }
- Attention of forgetting prototype declaration easily.
Problem
[ 4-1 ]
The entire program is completed by making the function according to the function, and combining it.
Because it becomes easy to make, even a big program :.