Question: Determine the output for the following program segment : a ) s = 2 0 ; for ( x = 2 ; x < 8

Determine the output for the following program segment :
a) s =20;
for (x =2; x <8; x = x +1)
{
s = s +1;
printf("s : %d
",s);
s = s +4;
}
[6 Marks]
b) int count =0, sum =0;
do
{
sum = sum +(count * count);
count = count +2;
}
while (count <10);
printf (Sum : %d
, sum);
printf (Count: %d
, count);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!