Computer Science, asked by thor54thunder, 8 months ago

. The output of the following pseudocode is ________ 1) Set a = 6, b =3, c = 2 2) if(b>a && a>c && c>b) 3) b = a + 1 4) Else 5) a = b + 1 6) End-if 7) Print a + b + c

Answers

Answered by thakurshubham758
19

Answer:

9

Explanation:

given a=6,b=3,c=2

condition is

if b>a AND a>c AND c>b [which is not satisfied, Since a>b]

then b=a+4

else a=b+1 [so here a becomes 3+1 i.e. 4]

So a+b+c = 4+3+2 = 9

Answered by SaurabhJacob
5

The output is,

9

The if statement will not get executed as,

  • it has three and(&&) involved in it, which means every condition should be true.
  • b is not greater than a.

So, the else statement will get executed which will set the value of a to one more than b.

After that print statement will print the sum of a, b, and c,

                                  =4+3+2\\=9

Hence the output will be 9.

Similar questions