Menu

Output Following Program Segment Sum 0 5 3 2 Else 1 Sum Sum 1 Systemprint Sum Enter Respon Q43840526

What is the output of the following program segment? sum = 0; i=5; do { if (i>3)i=i-2; else i=i-1; sum = sum + i; } while (i>

What is the output of the following program segment? sum = 0; i=5; do { if (i>3)i=i-2; else i=i-1; sum = sum + i; } while (i>1); System.out.print(sum); Enter your response here O Type here to search I BI e # 1 2 3 Show transcribed image text What is the output of the following program segment? sum = 0; i=5; do { if (i>3)i=i-2; else i=i-1; sum = sum + i; } while (i>1); System.out.print(sum); Enter your response here O Type here to search I BI e # 1 2 3

Expert Answer


Answer to What is the output of the following program segment? sum = 0; i=5; do { if (i>3)i=i-2; else i=i-1; sum = sum + i; } whil…

OR