The program shown below has many compilation errors. Rewrite the entire program,
ID: 3807233 • Letter: T
Question
The program shown below has many compilation errors. Rewrite the entire program, line by line, next to the original. If you need any additional statements to fix the compilation errors, be sure to include them (you can put in extra lines on the right). Fix all of the compilation errors but: DO NOT CHANGE THINGS THAT ARE ALREADY LEGAL IN C++. The final program that you write should compile without errors, but it does not have to make sense. You must REWRITE EACH line on the right--DO NOT OMIT any lines. include use namespace std; int main() int n, j, s char j; coutExplanation / Answer
Here is a compilable code. Please note its difficult to highlist issues as almost all line have issue so please compare them side by side.
#include <iostream>
using namespace std;
int main( )
{
int n, s;
char j;
cout << "enter a value";
cin >> s;
while (j < n)
n = 3*j - 2;
if (n >= j)
cout << n;
else
n = j--;
s++;
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.