# include void prime_check ( int n ); int main ( ) { int a; int b; int c; int d; int e[3] = { 12, 24, 36 }; float f; // // You can send in an integer constant. // prime_check ( 23 ); // // You can send in a variable. // a = 33; prime_check ( a ); // // You can send in one entry of an array. // prime_check ( e[2] ); // // What happens if you give the function bad input? // b = - 13; prime_check ( b ); c = 0; prime_check ( c ); d = 1; prime_check ( d ); // // What happens if you send in data of the wrong type? // f = 19.3; prime_check ( f ); return 0; } void prime_check ( int n ) { int i; printf ( "N = %i\n", n ); for ( i = 2; i < n; i++ ) { if ( n % i == 0 ) { printf ( "%i is not a prime number, it is divisible by %i.\n", n, i ); return; } } printf ( "%i is a prime number.\n", n ); return; }