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

Why does this program crash?

Name: Anonymous 2009-12-05 20:51

#include <stdio.h>

int main(){
   
    int i, j, num;
   
    scanf("%d", num);
    for(i=2;i<num;i++){
    j=i;
    if(num%j==0){
    printf("The number is not prime.\n");
    break;}
    else
    printf("The number is prime.\n");
}

system("pause");

return 0;
}

Name: Anonymous 2009-12-05 22:32

>>15
I think it's because we have a soft spot for Cee, if he'd used #include<iostream>, cout, cin, etc I imagine he would have received an ungodly amount of abuse.

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