I was wondering if you could clarify me the difference between the conditions while(k) and while(k > 0) when do they differ?
#include <iostream>
int main() {
int k;
std::cin >> k;
while(k) {
std::cout << "Hello" << "\n";
k--;
}
}
#include <iostream>
int main() {
int k;
std::cin >> k;
while(k > 0) {
std::cout << "Hello" << "\n";
k--;
}
}