In: Computer Science
Question 9
What is produced from the following code segment?
val = 0; do { val++; WriteLine(val); } while (val < 5);
Nothing is displayed |
||
Outputs 5 thru 9 |
||
Outputs 10 |
||
Outputs 1 thru 4 |
||
Outputs 1 thru 5 |
||
Outputs 10 thru 14 |
||
Outputs 0 thru 4 |
Question 10
Assuming val was described as an integer and an initial value of
10, what is produced from the following code segment?
do { WriteLine(val); } while (val < 10);
Nothing is displayed |
||
Outputs 5 thru 9 |
||
Outputs 10 |
||
Outputs 1 thru 4 |
||
Outputs 1 thru 5 |
||
Outputs 10 thru 14 |
||
Outputs 0 thru 4 |
Question 11
What is produced from the following code segment?
for (int val = 10; val < 5; val++) WriteLine(val);
Nothing is displayed |
||
Outputs 5 thru 9 |
||
Outputs 10 |
||
Outputs 1 thru 4 |
||
Outputs 1 thru 5 |
||
Outputs 10 thru 14 |
||
Outputs 0 thru 4 |
Question 12
Assuming val was described as an integer and an initial value of
10 and endVal is also declared as an integer with an initial value
of 15, what is produced from the following code segment?
while (val < endVal) WriteLine(val++);
Nothing is displayed |
||
Outputs 5 thru 9 |
||
Outputs 10 |
||
Outputs 1 thru 4 |
||
Outputs 1 thru 5 |
||
Outputs 10 thru 14 |
||
Outputs 0 thru 4 |
Question 13
Assuming val was described as an integer and an initial value of
10, what is produced from the following code segment?
while (val > 10) WriteLine(val);
Nothing is displayed |
||
Outputs 5 thru 9 |
||
Outputs 10 |
||
Outputs 1 thru 4 |
||
Outputs 1 thru 5 |
||
Outputs 10 thru 14 |
||
Outputs 0 thru 4 |
Question 9 What is produced from the following code segment? val = 0; do { val++; WriteLine(val); } while (val < 5); => Outputs 1 thru 5 Question 10 Assuming val was described as an integer and an initial value of 10, what is produced from the following code segment? do { WriteLine(val); } while (val < 10); => Outputs 10 Question 11 What is produced from the following code segment? for (int val = 10; val < 5; val++) WriteLine(val); => Nothing is displayed Question 12 Assuming val was described as an integer and an initial value of 10 and endVal is also declared as an integer with an initial value of 15, what is produced from the following code segment? while (val < endVal) WriteLine(val++); => Outputs 10 thru 14 Question 13 Assuming val was described as an integer and an initial value of 10, what is produced from the following code segment? while (val > 10) WriteLine(val); => Nothing is displayed
************************************************** Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.