All pastes #40251 Raw Edit

Miscellany

public text v1 · immutable
#40251 ·published 2006-02-06 05:02 UTC
rendered paste body
int main(){
    int number;
    printf("Enter the number you want to find the prime number to: ");
    scanf("%d", &number);
    int x = 2;
    int y=-1;
    while (x < number)
    {
        if (number%x==0)
        {
            printf("\nanswer is: %d\n", x);
            y=0;
            break;
        }
        else x=x+1;
    }
    if (y==-1) printf("Sorry!\n");
    return 0;
}