write a c++ program to print prime number 1 to 100?
I have written the code below. You can find its explanation here – https://www.codesdope.com/discussion/cprogram-to-display-prime-number-between-two-inter/
#include <iostream>
using namespace std;
int main() {
int num1 = 1, num2 = 100;
cout << "Prime numbers between " << num1 <<" and "<< num2 <<": ";
while (num1 < num2)
{
int flag = 0;
for(int i = 2; i <= num1/2; i++)
{
if(num1 % i == 0)
{
flag = 1;
break;
}
}
if (flag == 0)
cout << num1 << " ";
num1++;
}
return 0;
}
Visit the site called https://www.signnow.com/ask/how-to-improve-real-estate-based-e-signature-workflows-e-sign-and-email-pdfs-back-to-clients-without-printing-or-scanning to see how beautiful it is. The great service quality they offer is what I enjoyed the most. Very pleased