00:01
Hello student, here we have to find the output of the following pseudocode.
00:04
So here pseudocode, here 3, it is a type of a variable p, q, r are given.
00:09
Their values are also initialized p equal to 4, q equal to 2 and r equal to 4.
00:15
So here for loop we are using.
00:17
So for loop executing for two times, one for 5 and second one for 6.
00:23
So each from 5 to 6.
00:25
So here q equal to r plus r plus q.
00:30
So here q will be equal to q plus q plus r.
00:39
So plus q.
00:39
So here i am writing the value of q equal to r plus r is here 4 plus 4 plus q.
00:48
Here q become 10.
00:50
So now if statement in according to if statement, the first iteration become for here i am putting first iteration 4, 5, 4 plus 4 if statement in the if statement p plus r.
01:09
P is 4, r plus minus here 9.
01:16
We are comparing with 6 minus p, 6 minus 4.
01:23
So here what we find minus 1 here and here we find 2.
01:27
Yes, this is true.
01:29
So statement, if statement is true.
01:32
If this is true, now we will assign some p equal to inside the if statement p is updated to q.
01:39
So p become 10 because we have updated the value of q.
01:45
So here p updated and q updated 12 plus r.
01:50
So q become 12 plus r means 12 plus 4 equal to 16...