A c++ program to print the prime no.s between 100-200
Answers
Answered by
0
#include <iostream>
using namespace std;
int main()
{
int low = 100;
cout << "Prime numbers between " << 100 << " and " << 200 << " are: ";
while (low < 200)
{
flag = 0;
for(i = 2; i <= low/2; ++i)
{
if(low % i == 0)
{
flag = 1;
break;
}
}
if (flag == 0)
cout << low << " ";
++low;
}
return 0;
}
using namespace std;
int main()
{
int low = 100;
cout << "Prime numbers between " << 100 << " and " << 200 << " are: ";
while (low < 200)
{
flag = 0;
for(i = 2; i <= low/2; ++i)
{
if(low % i == 0)
{
flag = 1;
break;
}
}
if (flag == 0)
cout << low << " ";
++low;
}
return 0;
}
Similar questions
English,
7 months ago
Accountancy,
7 months ago
English,
7 months ago
Physics,
1 year ago
Chemistry,
1 year ago