I want to create a program to decide whether is number is prime or not, and i tried with this code, but my program does not seem to go into the while loop and come out with the my statements (i took them out for the forum)... does anyone have an idea why?
int main(){
int num;
int i=2;
cin >> num;
while (num % i != 0 && i<=num){
if(num % i == 0){
statement not prime
}
if(i == num){
statement is prime
}
i++;
}