[ create a new paste ] login | about

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

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

//Whats the point of these variables?
        int curcase, numcase, curnumber, number, i;

//Why are we grabbing this value here?
        scanf("%d", &numcase);

//What are we iterating through, and for what reason? Do you have any expectations of how many iterations?
        for(curcase = 1; curcase <= numcase; curcase++){

//What are we getting here, then? What is it going to be used for?
        scanf("%d", &number);

//Hey, we're printing something out!...what does it even mean? What should it print?
        printf("case %d: %d\n", curcase, number);

//What are we iterating through again? What purpose? To find what?
           for(i=2; i <= number; i++) {

//Some math! What is the equation doing?
                if(number % i == 0) {
//I have no idea what this print is doing for us
                    printf("(%d,%d)", i, (number/i));
                    printf("\n");
                }
//Okay, a comparison of...?
                if(i == number)
//How did we come to this conclusion?
                printf("This number is a prime!\n");

//What is the point of this check? Is this even neccesary considering the appliaction?
                else if(i > ((number/i)-2))
                break;

                }
        }
//What conclusion can we reach by hitting this line?
    return 0;

    }


Output:
No errors or program output.


Create a new paste based on this one


Comments: