i am trying to make a program that checks if the number is a prime number:
but when i run it after typing in the number it quitsCode:#include <stdio.h> int prime( int a ) int main(){ int b; printf("type in the number:") scanf("%d",&b); if (prime( b )==b){printf("of course");} else {printf("nope=no hope");} getchar(); return 0;} int prime( int a ){ int x; for(x=2;x<a;x++){ if(!(a%x==0)){return a;}}}
pleasse help!!!