First, I'll send the code.
#include <iostream>
using namespace std;
int main() {
int times = 0;
cout << "Enter a number of candies:";
int number;
cin >> number;
while (number >= 1000) {
cout << "Please enter an integer number between 0 and 999.\n";
cin >> number;
}
for (times <= 10; times++; number--) {
cout << "nomnom I have" << number - 1 << "candies left.\n";
}
}
I am trying to practice c++ because I'm a beginner so I made a little program that is supposed to allow you to enter a number between 1 and 999, then this is gonna be the number of candies. Then, it says how many there are left. It's not working though. Can anyone tell me why? Thanks.