- ..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 number in the memory put on the variable?
Example solution
[ 1-2 ]
What is called the method of the substitution of the above-mentioned number for the variable and the treatment?
Example solution
[ 2-1 ]
In the following program, though the return value of the sum function is void type
Explain concisely why it is at that can return the numerical result.
#include <stdio.h> void sum(int,int,int*); int main(void) { int value; sum(50,100,&value); printf("%d\n",value); return 0; } void sum(int min,int max,int *ans) { *ans = (min + max) * (max - min + 1) / 2; return; }
Example solution
[ 3-1 ]
From among two or more numerical values input within the range of 0-100
Make the program displayed for the maximum value and minimum value.
When -1 is input, the input is judged ending.
However, obtain the maximum value and minimum value in one function other than the main function.
Moreover, the number of array elements in which the input numerical value is memorized is assumed to be ten.
It is assumed it is reluctant even if the error occurs when input any more.
The hint: Data can be judged to end if there is -1 in the array.
The hint: Only have to repeat the comparison with the variable that memorizes the maximum value to look for minimum value.
Example solution
[ 4-1 ]
In the issue, explain concisely what the pointer is.
[ 1-1 ]
Address
Problem
[ 1-2 ]
Pointer
Problem
[ 2-1 ]
The third argument of the sum function is declared as a variable of the pointer type.
Because contents of the variable are rewritten directly by passing this the address.
Problem
[ 3-1 ]
- This problem is a quite difficult problem for the beginner.#include <stdio.h> void maxmin(int array[],int *max,int *min); int main(void) { int i = 0,array[10],max,min; Turn..number. scanf("%d",&array[i]); i++; } while (array[i - 1] != -1); maxmin(array,&max,&min); Printf ("Maximum value %d: Minimum value %d\n" max and min); return 0; } void maxmin(int array[],int *max,int *min) { int i = 0; *max = 0; *min = 100; while (array[i] != -1) { if (array[i] > *max) *max = array[i]; if (array[i] < *min) *min = array[i]; i++; } }
Read the example solution well.
Problem
[ 4-1 ]
Short cut variable of a certain variable