• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

a free c++ program

OK, I'll bite. By free c++ program I'm assuming you mean a compiler right? If so, just type free c++ compiler into google and you should get lots of hits.
 
I can write you a free C++ program if you want one, I don't guarantee it'll do much =)

Most of the free compilers you find will probably be based on gcc somehow, I would personally just use it. Find an editor you like with decent syntax highlighting, auto-indenting, etc (I like gvim, but it's not for the faint of heart) and you're good to go.
 
Yoyoyoy......... this is a program I made..... I just be stupid though so it may not work. let me know. btw, I'm a beginner at c++ so don't laugh too much

#include <iostream>
#include <ctime>

using namespace std;

int main()
{
long ArMax = 10000;

cout << "Amount of Prime #'s to calculate\n: ";
cin >> ArMax;

clock_t starttime = clock();

long *prime = new long[ArMax];

int pcount =0;
int divisible;

// Seeding
prime[0] = 1;
prime[1] = 2;
pcount = 2;


int x = 3;
int y = 0;

while ( pcount < ArMax ) {

divisible = 0;

for ( y = 0; y < pcount; y++ ) {
if (x % prime[y] == 0) divisible++;
if (divisible > 1) break;
}

if (divisible < 2) {
prime[pcount]=x;
pcount++;
}
x++;

}

cout << "Time: " << clock()-starttime << " ms\n\n";
return 0;
}
 
nothinman's offer is pretty weak, you think he'd offer a cool C program like THIS. 😛

Ok, so its mostly (all?) C instead of C++ but as C is a subset of C++... 😉
 
What are you getting at? You described 1 language, so you're use of 'any' is ambiguous and one poster even posted source code to a simple C++ program.
 
Back
Top