Question: What does the following program segment display? int f = 7, s = 15; f = s % 2; if (f != 1) { f

What does the following program segment display?

int f = 7, s = 15;

f = s % 2;

if (f != 1)

{

f = 0;

s = 0;

}

else if (f == 2)

{

f = 10;

s = 10;

}

else

{

f = 1;

s = 1;

}

Console.WriteLine(" " + f + " " + s);

a. 7 15

b. 0 0

c. 10 10

d. 1 1

e. none of the above

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 Systems Analysis Design Questions!