Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C Program

Name: Anonymous 2008-09-25 14:26

Programming newfag here. I'm trying to make a c program that determines whether a number is prime. It isn't working properly though. It only indicate that the number is not prime, regardless of the number, so something wrong. Anybody can help?

#include<stdio.h>

int main(void)
{

    int number;
    int count;
    int divisor = 2;
   
    printf("Input number for primality testing\n");
    scanf("d",number);
   
    while (divisor < number/2) {   
        if (number % divisor == 0) {
            break;   
        }
        else
            divisor++;
    }

    if (divisor == number/2) {
        printf("Number is prime\n");
    }
    else {
        printf("Number is not prime\n");
    }
    return 0;
}

Name: Anonymous 2008-09-26 12:28

hax my Anix

Name: Anonymous 2008-09-26 13:28

ANG (ANG's Not GNU (ANG's Not GNU's Not GNU's Not UNIX (ANG's Not GNU's Not GNU's Not UNIX's Not GNU's Not UNIX's Not UNIX (ANG's Not GNU's Not GNU's Not UNIX's Not GNU's Not UNIX's Not UNIX's Not GNU's Not UNIX's Not UNIX's Not UNIX (ANG's Not GNU's Not GNU's Not UNIX's Not GNU's Not UNIX's Not UNIX's Not GNU's Not UNIX's Not UNIX's Not UNIX's Not GNU's Not UNIX's Not UNIX's Not UNIX's Not UNIX)))))

Name: HAHAHaruhi !6mHaRuhies 2008-09-26 14:45

>>38
s/obsessed with/disgusted by/

>>39
no, but someone came up with Anonix Native User Space

>>40
are you talking about lulznix?

Name: Anonymous 2008-09-26 16:04

when the pedobear icon is clicked, have Ash Ketchum pop on screen and say PEDOBEAR! I CHOOSE YOU! and pokeball thrown etc etc and the pedobear icon grows in size as the wipe progresses. win?

Name: Anonymous 2009-03-06 5:28


Machine atm my wife   at haskell 98.

Name: ​​​​​​​​​​ 2010-10-24 6:29

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List