Answer:
3. Reads up to 3 values and places them in the array in the unused space.
Explanation:
cin.NextInt() reads the next value from the Scanner.
The while is just while the size is lesser than the capacity and the value is positive. It may read up to 3 values, and puts at the position size; Size starts at 3, that is, the first index which the value is 0, and goes up to 5. So it is the unused positions.
The correct answer is:
3. Reads up to 3 values and places them in the array in the unused space.
Answer:
- m = 3
- n = 20
-
- triList = []
- current = 0
- for i in range(1, n + 1):
- current = current + i
- if(current >= m and current <= n):
- triList.append(current)
-
- print(triList)
Explanation:
The solution code is written in Python 3.
Firstly, create variable m and n and set the value 3 and 20 to the variables (Line 1 -2)
Create a triangle number list (Line 4) and another variable current to hold the value of current total of triangle number (Line 5).
Create a for loop and iterate through the number between m and n (Line 6). Calculate the current total of triangle number (Line 7) and proceed to check if the current triangle number is bigger or equal to m and smaller and equal to n, add the current triangle number to triList (Line 8-9).
Print the triList (Line 11) and we shall get [3, 6, 10, 15]
Answer:
The Start or Start button was first introduced with the release of Microsoft Windows 95 and is found in all releases of Windows since. Start allows you to access your computer programs and configure Microsoft Windows easily by accessing the Start menu.
~Hello there!
Your question: Why is CPU called the brain of the computer?
Your answer: CPU is called the brain of computer because the CPU carries all the important calculations that helps the computer to process.
Any queries?
Happy Studying ^=^
Answer:alphabetic keys, numeric keys, function keys and special keys.
Explanation: