Predict the output of the following program segment: int a=15; if(a>10) { cout<<"You can buy the pen"; } else { cout<<"You can not buy the pen"; }Required to answer. Single choice.
You can buy the pen
You can not buy the pen
Run Time Error
None of these
Answers
Answered by
1
You can buy the pen.
•••••••••••••••••••••••••••••••••••••••
Hope you get helped!!!!
#BeBrainly
~@yash197911
Answered by
3
Required Answer:-
Given C∅de Snippet:
int a=15;
if (a>10) {
cout << "You can buy the pen";
}
else {
cout << "You can not buy the pen";
}
Language:
- C++
Output:
You can buy the pen
Explanation:
- As a = 15. Therefore, a > 10 is true as 15 > 10 is true. Therefore, the if block will execute.
- So, it prints the statement - cout << "You can buy the pen"; which displays the message - "You can buy the pen".
Similar questions