Computer Science, asked by thansih7123, 5 months ago

Write a C++ program to display all prime numbers between 100 and 200. ​

Answers

Answered by subgb98
0

Answer:

Time complexity O(n2)

#include<iostream>

using namespace std;

int main()

{

   for(int i=100;i<=200;i++)

   {

       int c=0;

       for(int j=2;j<i;j++)

       {

           if(i%j==0)

               c++;

       }

       if(c==0)

           cout<<i<<" ";

   }

   return 0;

}

Similar questions