Answer to Question #287546 in C++ for Jeanelle

Question #287546

Analyze and debug the following program then display the output.

 

 

A.

#include <iostream>

using namespace std;

 

main() {

 for (int i = 0; i >= 10; i = i + 2) {

   cout << i << "\n";

 }

 return 0;

}

 

B. 

#include <iostream>

using namespace std;

 

main() {

for (int i = 0; i < 10; i++) {

if (i == 4) {

continue;

 }

cout << << "\n";

 }  

 return0;

}

 

1
Expert's answer
2022-01-14T04:36:09-0500
#include <iostream>


using namespace std;
int main() {
	for (int i = 0; i <= 10; i = i + 2) {
		cout << i << "\n";
	}
	system("pause");
	return 0;
}







#include <iostream>


using namespace std;
int main() {
	for (int i = 0; i < 10; i++) {
		cout <<i<<"\n";
		if (i == 4) {
			continue;
		}
		cout <<  "\n";
	}  
	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment