Explanation :
Total 5 different student names all 5 group records in result. (In where condition no condition over Roll_no so query produces all groups.)
Explanation : According to “while” loop,
Initially i = 2.0, j = 1.0
i / j = 2.0 / 1. 0 = 2.0 > 0.0625
j = j + j
j = 2.0
printed sum = 0.0
Second time,
i / j = 1 > 0.0625
j = 4
printed sum = 0.0
Third time,
i / j = 0.5 > 0.0625
j = 8
printed sum = 0.0
Fourth time,
i / j = 0.25 > 0.0625
j = 16
printed sum = 0.0
Fifth time,
i / j = 0.125 > 0.0625
j = 32
printed sum = 0.0
Sixth time,
i / j = 0.0625 = 0.0625
It violates the greater then condition.
This time while loop will not execute.
Explanation : Given, “for” loop will run from i=0 to 4.
i = 0
sum = 0+ 10 – 10 = 0
i = 1
sum = 0 + 9 – 8 = 1
i = 2
sum = 1 + 8 – 6 = 3
i = 3
sum = 3 + 7 – 4 = 6
i = 4
sum = 6 + 6 – 2 = 10
Now, loop terminate and value of sum (i.e., 10) will be printed.
So, The output of above C program is 10.