148k views
1 vote
What is the value of sum after the code segment is executed?

What is the value of sum after the code segment is executed?-example-1
User Bahrom
by
6.1k points

1 Answer

11 votes

Let's go as per program

  • 6<4 ? False

Else will be conducted

  • num3=num2=4

So

  • num2>=num3 ?False

No else statement is available

Now the present values are

  • num1=6
  • num2=num3=4

Sum=6+2(4)=6+8=14

User Majid Hojati
by
6.0k points