subject

The following is an attempt to display a table of Celsius temperatures and their Fahrenheit equivalents in the range 0 to 20. int celsius;
for ( celsius = 0; celsius <= 20; celsius =+ 1 );
{
double f = 9 / 5 * celsius + 32;
cout << celsius << " C == "
<< f << " Fahrenhiet "
<< endl;
}

Although this code compiles without complaint, it has more than one mistake. Pick the answer that correctly identifies a mistake with the use of the C++ iteration statement.

A. The double variable f must be declared prior to the for loop.
B.
The correct for loop header for this iteration is,
for ( celsius = 0; celsius < 20; celsius =+ 1 )
C.
Remove the semicolon from the line with the for loop header.
D.
The statement that computes the equivalent temperature in Fahrenheit is wrong. It should be the following,

double f = 9.0 / 5.0 * celsius + 32;

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 22.06.2019 17:50
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
You know the right answer?
The following is an attempt to display a table of Celsius temperatures and their Fahrenheit equivale...
Questions
question
Biology, 22.10.2019 23:00
question
Mathematics, 22.10.2019 23:00
question
Mathematics, 22.10.2019 23:00
Questions on the website: 13722367