please answer all of these multiple choices and questions Th
please answer all of these multiple choices and questions. Thanks
What rod tbe the ostyst predsced frem the Siloving watmes a 23 1234 none of the abone program fragmens do? t doss the folewirg compato the sum of the integers from I through n a computes the sum of the integves from L through n -1 computes the sum of the ewn integers from 1 through n compute) the \"an et the odd irtrgers turn l through n To produce the output 268 0 which should be the leop conditional expression to replace the qeestice (22721Solution
Please follow the data and description :
1) CODE :
int aValue = 1;
do{
aValue++;
Write(aValue++);
} while(a < 31);
OUTPUT :
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
So the answer is OPTION E (None of the above).
2)
The given code iterates over the loop for the given value of n and that makes a looping values, then the value is checked for the even or odd and then sums up the value to the previous value in the respective vraiable if the number generated is an even number.
So the answer is OPTION C (Computes the sum of the even integers from 1 through n).
3)
To loop over the code to print the output as 2 4 6 8 10 the while consdition is to be place with the code as n > 11 so that the looping is done till and that the last value to be printed would be 10.
So the answer is OPTION A (n > 11).
4)
Here in the code the while loop condition is set to check if the value is greater than 1 which is a never ending and an indefinite case where the looping never ends as the value is being incremented inside the loop and that the condition never fails.
So the answer is OPTION B (an Indefinite loop).
5)
Pretest Loop : This is kind of loop where the consdition is first checked and then proceeds for the next execution only if is satisfied. Some of its kinds are the while and the for loop.
So the answer is OPTION E (a and c).
6)
The code next to the looping statements is supported by a curly baraces represented as {}. So the answer is OPTION D (curly braces).
7)
The condition that is used of the loop to read is the
while(i < 5)
So this conveys that the loop will break if the value of i is greater than or equal to 5 so as the input is taken from the user and that the loop iterates till the user has entered a value that is greater than or equal to 5.
So the answer is OPTION E (until a number 5 or larger is entered).
8)
In the condition after the user entered the value the number is checked if it is a positive or a negative value. If this is negative value the count or the value of the x is oncremented by 1.
So the answer is OPTION D (the sum of all the negatives items entered).
9)
Sentinel-controlled loop : It is a repetition or evenly called an indefinite repetition because it is not known in advance how many times the loop will be executed.
So the answer is OPTION B (sentinel controlled loop).
10)
This is to be noted that there are 2 for loops with different conditions. So the first iterates 3 times and the inner one iterates 4 times for the each outer loop which means the output is generated in 3*4 = 12 times.
So the answer is OPTION D (12).
11)
This is to be noted that there are 2 for loops with different conditions. So the first iterates 1 times as is incremented by 2 and should be less than 3 and the inner one iterates 2 times for the each outer loop which means the output is generated in 1*2 = 2 times or 2 lines.
So the answer is OPTION E (none of the above).
12)
The code given iterates from 0 to 10 and prints the result to the same line. So teh output is 0123456789. So the answer is OPTION C (0123456789).
Hope this is helpful.


