[ create a new paste ] login | about

Link: http://codepad.org/x5xnszWK    [ raw code | fork ]

C, pasted on Feb 8:
    int main() {

        int curcase, numcase, curnumber, number, i;

        scanf("%d", &numcase);

        for(curcase = 1; curcase <= numcase; curcase++){

        scanf("%d", &number);

        printf("case %d: %d\n", curcase, number);

           for(i=2; i <= number; i++) {
                if(number % i == 0) {
                    printf("(%d,%d)", i, (number/i));
                    printf("\n");
                }
                if(i == number)
                printf("This number is a prime!\n");

                else if(i > ((number/i)-2))
                break;

                }
        }

    return 0;

    }


Output:
No errors or program output.


Create a new paste based on this one


Comments: