Can someone please tell me what is wrong with this code?
#include <stdio.h>
#include <stdlib.h>
char * prime(int N);
int main()
{
char* p = prime(13);
printf("%s", p);
return 0;
}
char * prime(int N)
{
int i,j=1;
char yes[] = "Number is a prime";
char no[] = "Number is not a prime";
for(i=2; i<=N-1; i++)
{
if(N%i == 0)
j=0;
}
if(j == 1)
return yes ;
else
return no ;
}
Expected output =
Number is a prime
Shown output =
$0@