Answers for "nested loop c++"

C++
1

nested loop c++

#include <iostream>
using namespace std;
 
int main () {
   int i, j;
   
   for(i = 2; i<100; i++) {
      for(j = 2; j <= (i/j); j++)
         if(!(i%j)) break; // if factor found, not prime
         if(j > (i/j)) cout << i << " is prime\n";
   }
   
   return 0;
}
Posted by: Guest on March-11-2020
-1

nested loop c++ program example

nested loop cpp example
Posted by: Guest on August-03-2021
-1

nested loop c++ program example

nested loop cpp
Posted by: Guest on August-03-2021

Browse Popular Code Answers by Language