- # Algorithm to find the number of integers greater than 10 in a list
- list = read(list of integers)
- n = len(list)
- count = 0
- For i = 1 to n
- If list[i] > 10:
- count = count + 1
- Endif
- End
- Return count
<h3>
Explanation:</h3>
Then the length of the list is stored in a variable n. A variable count to store the number of integers more significant than 10 is initialized to 0.
- Then, a for-loop is used to iterate over the list. A for-loop is used in this case because every element of the inventory needs to be checked for a value greater than 10.
- In each iteration of the for-loop, the value at the index of the list is checked. If the value is greater than 10, then the counter variable count is incremented by 1.
- The iterations continue till the for-loop ends. At this point, the variable count will be the number of integers greater than 10.
- Note that in case the list does not have any number greater than 10, then the count variable will be 0.
To learn more about it, refer
to brainly.com/question/25311149
#SPJ4
Answer:
False
Explanation:
vector is like a dynamic array that has a special ability to resize automatically when it required.
vector has several functions:
like, insert() to insert the element in the vector.
delete() for delete the one element at a time.
empty() is also the function used in the vector. It is used for checking the vector is empty or not.
it gives the Boolean value (TRUE or FALSE), if the vector is empty it gives the output TRUE if the vector is not empty it gives the output FALSE.
It is not used for empty or deletes all elements of the vector.
Therefore, the answer is False.