Question
(2 points) Which of the following increments x by 1? 1++; x + 1; x = 1; x += 1; x+; (2 points) Name one
(2 points) Which of the following increments x by 1?
1++;
x + 1;
x = 1;
x += 1;
x+;
(2 points) Name one command that is used to implement the decision statement control structure.
(2 points) Name the 3 C++ statements used to create a loop.
(2 points) What will the following code display on the screen and where will it display?
for (i = 0; i < 5; i++)
cout << " ";
cout << i;
(2 points) Write a for loop to display the first 5 multiples of 10 on one line. For example: 10 20 30 40 50
(2 points) Write a while loop to display the first 5 multiples of 10 on one line. For example: 10 20 30 40 50
(2 points) When is the 3rd subexpression in for (--; --; --) statement executed?
(2 points) Write a decision statement to test if a number is even or not. If it is, print "even". If it is not, add 1 to it and print "it was odd, but now it's not".
(2 points) Why is a while loop described as "top-driven"
(2 points) If a read-loop is written to process an unknown number of values using the while construct, and if there is one read before the while instruction there will also be one
at the top of the body of the loop
at the bottom of the body of the loop
in the middle of the body of the loop
there are no other reads
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started