ch 8/e10.c
//Function to check if number is prime

Function to check if number is prime
Function to check if number is prime
int prime ( void )
	{
		if ( global_n % 2 == 0 )
			return 0 ;
		for ( int p = 3; p <= global_n / 2; )
			{
				if ( global_n % p == 0 )
					return 0 ;
				else
					p += 2 ; 
			}
		return 1 ;
	}
int prime ( void ) { if ( global_n % 2 == 0 ) return 0 ; for ( int p = 3 ; p <= global_n / 2 ; ) { if ( global_n % p == 0 ) return 0 ; else p += 2 ; } return 1 ; }
Function to check if number is prime
Function to check if number is prime
//Returns 1 if prime and 0 if not prime
