Generating prime numbers
Post your C++ code snippets in here.
1 post
Page 1 of 1
hey guys
with this bit of codes you can generate prime numbers in c++

download program
with this bit of codes you can generate prime numbers in c++
Code: Select all
working proof #include <iostream>
using namespace std;
int main()
{
int i, j;
for ( i = 2; i < 100000; i++ )
{
for ( j = 2; j <= i/2; j++ )
{
if ( ! ( i % j ) ) break;
}
if ( j > i / 2 ) cout << i << endl;
}
return 0;
}

download program
You do not have the required permissions to view the files attached to this post.
Find my programs on Softpedia
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023