Code:
Short answer: no.
Better answer:
Since you are using is_prime as a boolean-valued variable (only true or false), declare it
as type bool instead of int.
When you type
bool is_prime;
or
int is_prime;
you are declaring the variable (allocating memory space to hold a value of the
specified type) and giving it a name.
When you type
is_prime = true;
you are assigning a specific value to be stored at that location.
When you type
bool is_prime = true;
you are simply combining those two steps.
Thereafter, since the variable is_prime already exists, whenever you want to assign a
value to that same variable, just use the assignment command.
In your example, if you wrote
bool is_prime = false;
inside that while loop, you would actually be declaring (and assigning as "false") a
completely new variable named "is_prime" which only "exists" inside the {} block of that
loop, and is completely independent of and has no effect on the other "is_prime"
variable that you declared at the beginning of your main function.