I am currently learning how to use Pari GP and right now i am trying to write out a code on checking whether if the user did key in a prime number or not.
Here is my code.
printf("\t%s \n","PrimeNo(P): To check if it is a prime or not");
PrimeNo(p)={
if(isprime(p)||1, print("Prime numbers only"));
if(isprime(p)||0, print("Prime numbers stored"));
print(p);
}
Problem is my first "if" line works by identifying that it was not a prime, but when i key in a prime number, both line appeared.
Would appreciate if anyone can help.