There\'s something wrong with my code. Could someone help? #include <iostream.h>
ID: 3623774 • Letter: T
Question
There's something wrong with my code. Could someone help?#include <iostream.h>
int main(void) {
int x = 0;
int y = 0;
cout << "Please enter an integer between 1 and 10: "
cin >> x;
cout << "You entered: " < x << endl << endl;
while ((x < 1) || (x > 10)) {
cout << "Please enter an integer between 1 and 10: ";
cin >> x;
cout < "You entered: " << x << endl << endl;
if ((x < 1) | (x > 10))
cout << "Your value for x is not between 1 and 10!"
<< endl;
cout << "Please re-enter the number!" << endl << endl;
}
}
cout << "Thank you for entering a valid number!" << endl;
return 0;
}
Explanation / Answer
//It looks good. You just forgot a few things here and there #include int main(void) { int x = 0; int y = 0; cout > x; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.