[Solved] C Program to find prime number
[ad_1] I just modified your function a little. Here is the code #include <stdio.h> #include <math.h> int prime(int a) { int b=2,n=0; for(b=2; b<a; b++) { if (a%b==0) { n++; break; } } return(n); } int main(void) { int c, answer; printf(“Please enter the number you would like to find is prime or not= “); … Read more