Two parter:

A.) What is wrong with the program segment below? The program does not contain syntax errors.

B.) Fix the programming error(s)

num = 1;

while (num < 9)
{
cout << num;
num = num - 1;
}

Answers

Answer 1

Answer:

the variable num is not declared so the compiler doesn't define it.

add int before num:

int num = 1;

while (num < 9)

{

cout << num;

num = num - 1;

}

now the code will run but it won't stop as it will never break the condition (num < 9).


Related Questions

Other Questions
Who would be invited or inclined to attend a hearing on a bill can someone please help me asap ill give extra brainly points!!! Dishwasher detergent is sold in individual packs is sold in 20, 60 and 90 pack containers which container do you think has the lowest unit rate of dollars per pack and why 3. Which of the following statements best explains how the cell membrane 1 pointis selectively permeable? *The movement of specific substances into and out of the cell is controlled by the cellmembraneThe movement of waste substances into, but not out of the cell is controlled by thecell membraneThe cell membrane is inflexible and cannot control the movement of substances intoand out of the cellThe cell membrane does not surround the cell so it plays no role in the movement ofsubstances Pov:: You are going for a walk and randomly a person wearing a suit runs up to you and says this Weve been trying to contact you regarding you cars extended warranty for quite some time now, this will be out final attempt to try and reach you.(Someone said i needed to type more and this is all i could think of.) Examine Item A in your test documents. Which municipal area most likely hasthe least influence on elections due to the reapportionment shown?A. GardinerB. WoodstockC. ShawangunkD. Rochester True or false: The following sentence is correct? In thirty years, Rodriguez claims, we will all be in driverless cars. Select one:TrueFalse Europe and United States use geothermal power extensively.TrueFalse write a mathematical equation and calculate the area of the irregular polygon On Tuesday, Chris swam 6 laps in 5 1\10 minutes. On Wednesday, he swam the same distance in 4 7\10 minutes. How much faster did he swim on Wednesday?and please show the answer. 10 extra points for work showed :) ANSWER THE QUESTION FOR BRAINLIEST Plsss help me on this Ellen has a balance of $15,000 on her car loan and an interest rate of 2.75%. To pay off the $15,000 in five years, Ellen will have to make a minimum payment of $267.87. If Ellen pays $434.57 per month she can pay off her auto loan in 3 years instead. How much more will Ellen pay if she takes 5 years to pay off her loan instead of 3 years? Which of the following is a true statement?New matter is being created all the time.Matter is never created only changes from one form to another.Matter can never be changed from one form to another. On a summer's day, beach sand will feel, and be, much hotter than the adjacent water due to the sand's lower thermal conductivity.true or false? T-T Please help me with the answer to these. The second picture goes along with the first Pls help I have this homework !! bye I will mark you the best or brainliest!! helpppp helping my sister Q3: In Placental Mammals the mother provides the embryo with everything it needs. True or False q4: In Metamorphosis, major body changes occur, as animals develop from young organisms into adults. True or False q5: Complete Metamorphic has three stages. True or False q6: Incomplete Metamorphic has four stages. True or False q9: The stage in which a young insect is enclosed in a protective covering is egg. True or False He was very nice and talked slow like Miss Kinnian does and he explaned it to me that it was a raw shok. He said pepul see things in the ink. I said show me where. He said think. I told him I think a inkblot but that wasnt rite eather. He said what does it remind you - pretend something. I closd my eyes for a long time to pretend. I told him I pretned a fowtan pen with ink leeking all over a table cloth. Then he got up and went out. Flowers for Algernon, Daniel Keyeswhat characterizes Charlie in this passage description of Charlie what other people say about Charlie how Charlie thinks