Check whether prime or not

if(n==1) return false;
if(n==2) return false;

for(int i=3;i*i<=n;i+=2){
if((n%i)==0) return false;
return true
//in this loop why we don’t check for even numbers I know they are not prime but we are checking if n is prime or not so we should check for root n times whether it is divisible by any number or not

bcz
2 is only even no. that is prime.
thereafter none of even no. is prime so why should we waste our time to check prime for rest of even no.s, we should only check for odd no.s !!