Answer:
The size of the array is dependent on the amount of memory the program can access.
Explanation:
Here according to the question the user is in need of memory space equal to the amount of numbers read from the list. So the size of the array should be equal to the total numbers read from the list. if the user reads 5 number from the list then the size of the array should be int a[5] if the numbers are integers. Wastage of memory space is not appreciated in a good piece of code.
Answer:
Follows are the solution to these question:
Explanation:
Please find the complete question in the attached file.
For point a:
The "j" is the loop control variable that controls this loop
For point b:
The initialized statement for the given loop is "j = 1"
For point c:
The loop condition for the given loop is "j<=10" which indicates that the value of j is less than equal to 10.
For point d:
The loop given statement that updates the value of the s is "s = s+j*(j-1)".
Answer:
numberOfPrizes%numberOfParticipants==0
Explanation:
- Above expression includes % sign, which means mod.
- Mod of a value with another makes the 1st value divide by 2nd and return the remainder.
- As numberOfParticipants cant be zero (given), the answer must be a proper number.
- If numberOfPrizes is completely divisible by numberOfParticipants then it will return 0 as shown in above expression. True case.
- If a digit other than 0 is a result then it will be false.
Structures can be accessed from anywhere within the module or class in which they are declared. A structure is Friend by default. To specify the accessibility in more detail, include Public, Protected, Friend, Protected Friend, or Private in the Structure statement. You must declare every data member of a structure.