Primality test giving wrong answers on large numbers?
I wrote a simple C++ program in Visual Studio Community edition that checks if a number given to the program is a prime number or not:
C++ program giving wrong answers
I wrote a simple C++ program in Visual Studio Community edition, that checks if a number given to
the program is a prime number or not. The program works for small numbers but when it is given a big number, the program gives wrong answers. I want to find out what’s wrong with the program. Where is the fault in the program. Following is the program: