Which line in the following program will cause a compiler error? #include using namespace std; int main() { int number =5; if (number>=0&&<=100) cout<<"passed.\n"; else cout<<"failed.\n"; return 0;

Respuesta :

ijeggs

Answer:

  1. #include  <iostream>
  2. using namespace std;
  3. int main() {
  4. int number =5;
  5. if (number>=0&& number <=100){
  6.    cout<<"passed.\n";
  7. }
  8. else{
  9.    cout<<"failed.\n";
  10. }
  11. return 0;
  12. }

Explanation:

There where multiple errors in the code given in the questions

Line 1: Missing <iostream>

Line 5: The comparison operator was wrong correction is highlighted

Line 12 Missing closing brace for the main function

All the errors have been fixed and the code above compiles

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE