Question: My C++ code has no errors but will not display output when I build solution. Can someone help? Code: int main() { int n=0; while

My C++ code has no errors but will not display output when I build solution. Can someone help?

Code:

int main()

{ int n=0; while (n>=0); { int n, a = 1, b = 1, c, sum = 0; cout << "Please enter in sequence number (or -99 to quit): /n"; cin >> n; if (n >= 0) { c = 0;

for (n = 1; n < 20; n++); { c = a + 2 * b; cout << c << " "; sum += c; a = b; b = c;

} cout << "sum: " << sum << endl;

}

else if (n == -99) return 0; else if (n < 0 && n != -99) cout << "Enter a number >= 0 or -99."; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!