Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int a;
6.
a = 5 + 3 * 5;
7.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int a;
6.
a = 5 + 3 * 5;
7.
cout
Answer: Option B
Was this answer helpful ?
Because the * operator is having highest precedence, So it is executed first and then the + operator
will be executed.
Output:
$ g++ op1.cpp
$ a.out
20
Was this answer helpful ?
Submit Solution