#include <iostream>
#include <cmath>
using namespace std;
int main() {
int i = 0;
int square = 0;
// Write a while loop here:
while ((i <= 9) && square == pow(i, 2)) {
cout << i << square;
i++;
}
}
//Why is this not printing out
/* 0 0
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
*/
/Can someone explain to me thoroughly as to why this while loop fails to print out this sequence of numbers.
I don't understand why this only prints out 00 instead of that list of numbers. Can someone explain to me as why this while loop does not work properly?/