Task: Using your language of choice, implement a program that will a) Prompt the user for 2 numbers, and b) output the number of prime numbers between the two numbers (inclusive.)
Output: A B N
Name:
Anonymous2008-05-08 20:36
These "challenges" are stupid.#include <math.h>
#include <stdio.h>
int is_prime(int n) {
int i, m=sqrt(n);
for(i=2; i<=m; i++) {
if (n%i == 0)
return 1;
}
return 0;
}
int main(int argc, char** argv) {
int a, b, i, num;
scanf("%d",&a);
scanf("%d",&b);