/*****************************************
* Let's pick an arbitrary number, *
* because >>1 didn't specify which one! *
* I think I'll choose ``1". *
*****************************************/
int main(void) { return 0; }
Name:
Anonymous2012-10-02 19:08
long long primes[] ={ 2, 3, 5, 7, 11, 13, 17, 23}; // TODO: ADD THE REST OF THE PRIMES HERE
long long num = 8; // number of primes goes here
int main()
{
int input = 0;
printf("number:");
scanf("%d",&input);
for(int i = 0; i < num; i++)
{
if(primes[i] < input)
{
printf("%d",primes[i]);
}
}
return 0;
}
This is easy. I'll hint, then you give me a biscuit.
Make an array for primes for N/2,
make and integer, i, with a limit max of N,
Continuously increment i, and test that it is not divisible by 2 and it is not 2,
if not, increase i again and repeat loop from start,
save i to an array of i's,
Test in a loop that prime[i] is not divisible by prime[test],
if not, increase i again and repeat loop from start,
print i
Then print, "I am done teach. give me a biscuit."
Name:
Anonymous2012-10-02 20:56
>>14 god damn you people suck. why the fuck do i have to take comp sci if im a business major???
So the JEWS can get your tuition and use it to let niggers and illegal, unwashed mexicans in for free.
Name:
Anonymous2012-10-02 21:01
>>14
Now you should really quit while you can. I am >>15-kun, And that statement is like say,
"Why do I have to sign things, when all I want to do is own the fucking place?"
Business major is programming revenue, dipshit. If you cannot get simple algorithms, you will never make it past the next month of any you start.
Get a math theory book, and get started, or I will smash personally
Name:
Anonymous2012-10-02 21:03
>>17
i don't care about computers or math. my family already owns a company i just want the degree :)
Name:
Anonymous2012-10-02 21:05
>>18
you are so retarded, that you can't write such a simple algorithm? kill yourself please.
OP, for the sakes the rest of your life, either kill yourself, or go to the art department. You do not deserve the degree with that mentality. Or even your computer.
Name:
Anonymous2012-10-02 21:24
>>23
i'm not a fucking faggot art student and im not about to hang out with faggots who obsesses over the size of a cock in some abstract bullshit and thinks it means the stuggle of man to fight the cops or or some equally retarded
and BA is way worse than a BS
Name:
Anonymous2012-10-02 21:27
Sure, it's easy, but is it Abelson easy?
Name:
Anonymous2012-10-02 21:30
>>24
No wonder you can't program, you can barely even speak English. Might be best to drop out and stick with manual labor.
Name:
Anonymous2012-10-02 21:33
>>24
I love it when you fall in your trap. See you in art class. I would love to see your Dark Oppressive art.
I'm printing the hard-coded array [2 3 5 7 ...], but there must be some `mathematical' way of doing it, i just can't remember how.
Name:
Leah Culver2012-10-02 22:12
That seems to me like something people would remember if they had used it before. I’d never had to print prime numbers before and I kept thinking that there was some way to do it mathematically, but I couldn’t remember how. I hope it’s not as important to know the best solution as it is to know a better solution exists.
Name:
Anonymous2012-10-02 22:56
Enjoy fucking Richard Stallman's hairy man boobs while the sweet Leah is rubbing my dick between her white, soft, aryan, valkyriesque mammaries.