Question: Given the following code: 1 ) bool inRange ( int x ) 2 ) { 3 ) / / Determine whether x is within the

Given the following code:
1) bool inRange(int x)
2){
3)// Determine whether x is within the range 5..10
4) if (x <=10)
5) if (x >=5)
6) return true;
7) else
8) return false;
9)}
int main()
{
int num =14;
if (inRange(num))
cout << num <<" is in the range" << endl;
else
cout << num <<" is not in the range" << endl;
cout << endl;
return 0;
}
Which line in the above code, if any, has an error? If no line is incorrect your answer should be 0(zero). Please enter a line number only (do not include blank spaces or parenthesis).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!