hey guys,I'm soo beginner in C++ :$ .could you please explain logic of the loop
#include <iostream>
using namespace std;
int main()
{
int x = 0, p = 5;
while(x < p)
{
for(int i = 0; i < x; i++)
{
cout << "+";
}
cout << "\n";
x++;
}
}
the output will be
+
++
+++
++++
but I couldn't understand this part
for(int i = 0; i < x; i++)
i<x ? how the loop going to continue when i is zero and x is zero too