Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

prime number c program

int isPrime(int n) {
  for (int i = 2; i < n; i++) if (n % i == 0) return 0; 
  return 1;
}
Source by www.w3schools.in #
 
PREVIOUS NEXT
Tagged: #prime #number #program
ADD COMMENT
Topic
Name
2+8 =