int input; cout > input; int i = input / 2; int d; for (i >= 2; i--;) { d = input % i; if (d == 2 || i == 1) cout


int input;


       cout < "enter="" input="" "=""><>


       cin >> input;


       int i = input / 2;


       int d;


       for (i >= 2; i--;) {


              d = input % i;


              if (d == 2 || i == 1)


                     cout < "not="" prime"=""><>


              else


                     cout < "prime"=""><>


}


This code outputs prime numbers as both "prime" and "not prime" but I just want it to say "prime".


Please help me with this problem using c++.



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here