Ask Question
21 April, 02:24

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

+2
Answers (1)
  1. 21 April, 05:54
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers