Answer:
int withinArray(int * intArray, int size, int * ptr) {
if(ptr == NULL) // if ptr == NULL return 0
return 0;
// if end of intArr is reached
if(size == 0)
return 0; // element not found
else
{
if(*(intArray+size-1) == *(ptr)) // check if (size-1)th element is equal to ptr
return 1; // return 1
return withinArray(intArray, size-1,ptr); // recursively call the function with size-1 elements
}
}
Explanation:
Above is the completion of the program.
Answer:
- If a group of 9 kids have won a total of 100 trophies, then at least one of the 9 kids has won at least 12 trophies.
- If a person buys at least 400 cups of coffee in a year, then there is at least one day in which the person has bought at least two cups of coffee.
- The average of three real numbers is greater than or equal to at least one of the numbers.
Explanation:
1)
Suppose that each kid has less than 12 trophies
Total trophies = 100
Maximum trophies won by one kid = 11
total kids = 9
total number of trophies = 9 * 11 = 99 which contradicts the fact the total number of trophies are 100
2)
Suppose that person has less than 2 cups of coffee a day
Total cups of coffee = 400
he has bought at least one cup of coffee each day
which means
total number of cups of coffee = 1* 366 = 366 which contradicts the fact the person buys at least 400 cups of coffee in a year
3)
Average of three number = (a+ b+ c)/3
suppose that there are real numbers a, b, and c such that all three numbers are less than the average of the three numbers.
Let m be the average (a+b+c
)/3 = m. Then our assumption states that (a < m) and (b < m) and (c < m). By adding all the inequalities we get a + b + c < 3m. But m is defined to be (a+b+c)
/3 , so a + b + c = 3m. But now we have that 3m = a + b + c < 3m. So 3m < 3m which is an obvious contradiction. Thus our claim is true
Spring break around Easter I would believe
The type of file which can be PNG, Jpg, etc.