Which line in the following program will cause a compiler error? #include using namespace std; int main() { int number =5; if (n umber>=0&&<=100) cout<<"passed.\n"; else cout<<"failed.\n"; return 0;
1 answer:
Answer:
#include <iostream> using namespace std; int main() { int number =5; if (number>=0&& number <=100){ cout<<"passed.\n"; } else{ cout<<"failed.\n"; } return 0; } 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
You might be interested in
The first step would be knowing the manufacturer s recommended schedule for maintenance
They both need electricity. Both used in the kitchen.
If the language is zero indexed: a[ 33 ]
Paste special allows the item being transferred to be formatted in several different ways. Paste is just going to be transferred the exact way you copied it.
When was the Ming dynasty established?
the 1100s CE
the 1200s CE
the 1300s CE
the 1400s CE