What error in if loop'e C#code?

Good afternoon/evening!
Recently started teach yourself C# book Head first C# 3d Ed. In one of the tasks it was necessary to include lines of code and paste instead of spaces in the program code. Made a mistake in the second if loop'e with the condition and I do not understand why the answer is x>0. I would be glad if someone explain. Here is the solution.
Thanks in advance!

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PoolPuzzle
{
 public partial class Form1 : Form
{
 public Form1()
{
InitializeComponent();
}
 private void button1_Click(object sender, EventArgs e)
{
 string result = "";
 Echo e1 = new Echo();
 Echo e2 = new Echo(); // Bonus answer: Echo e2 = e1;
 int x = 0;
 while (x < 4)
{
 result = result + e1.Hello() + "\n";
 e1.count = e1.count + 1;
 if (x == 3) // Alternate solution: x == 4
{
 e2.count = e2.count + 1;
}
 if (x > 0) // Alternate solution: x < 4
{
 e2.count = e2.count + e1.count;
}
 x = x + 1;
}
 MessageBox.Show(result + "Count:" + e2.count);
}
}
}
October 3rd 19 at 01:42
1 answer
October 3rd 19 at 01:44
The window displays four lines "helloooo..." and calculates the number of attempts (answer : 10).
The number of attempts at an alternative solution is 24 because the second object is a reflection of the first (if I understood correctly).
Reflection is another story. Just these two variables will point to same object. And your question is not very clear - for x>0 it turns out the correct result (10) that you want explained to you? - Rashawn_Stiedemann commented on October 3rd 19 at 01:47
I want to understand the solution to this problem.When I solved it, something was wrong in the condition of the second loop : x > 0. Why, to get the result 10 and 4 times the echo need the condition x > 0? - stefanie commented on October 3rd 19 at 01:50

Find more questions by tags C#