i'm writing a program that classifies positive integers as odd or even but when I type a number the loop doesn't stop. It will say even or odd depending on the number but it won't stop.
x doesn't change within the while loop, so the loop either doesn't run at all (if x>0 is false) or it runs forever (if x>0 is true). To fix this, I'd change x to be unsigned instead of int so the compile can enforce the requirement that values be non-negative. Then move the cin >> x inside the while loop: while (cin >> x) {