How to find if a number is prime or not without division repeatedly : <p>I was told to make a program in C to find whether a number is prime or not and factorize it. I used repeated division method, i.e. I repeatedly divide the number by integers starting from 1 to that number, and if the remaining is 0 not more than 2 cases(1 and that number) the number is a prime number, otherwise it's not. But my teacher said that if a large number was there in input, the program would take much time to process it, so it was wrong. He said to create a new program but I can't understand how can I check if a number is prime or not without this method, so please anyone help me.</p>
