Ask Question
19 May, 10:11

Which line in the following program will cause a compiler error?

1. #include

2. using namespace std;

3.

4. int main ()

5. {

6. int number = 5;

7.

8. if (number > = 0 && < = 100)

9. cout << "passed./n";

10. else

11 cout << "failed./n";

12 return 0;

13 }

A) 8 B) 6 C) 10 D) 9

+1
Answers (1)
  1. 19 May, 10:59
    0
    The answer is "Option A".

    Explanation:

    In the given C+ + Language program on line 8 compile-time error will occur, because in the code the conditional statement is used. In if block, we check two conditions together, which is the number variable value is greater than equal to 0 and check less than equal to 100. In this condition statement, a AND operator is used that execute when both condition is true, but in the last condition, we do not define a variable name that, checks value. That's why the program will give an error on line 8.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which line in the following program will cause a compiler error? 1. #include 2. using namespace std; 3. 4. int main () 5. { 6. int number = ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers