Computer Science, asked by sourish3201, 4 months ago

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 yash197911
1

\huge{\tt{\underbrace{\red{answEr}}:-}}

\purple \leadsto You can buy the pen.

•••••••••••••••••••••••••••••••••••••••

Hope you get helped!!!!

#BeBrainly

\: \: \: \: \: \: \: \:~@yash197911

Answered by anindyaadhikari13
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