I have skip checking the number 1 and 2 intentionally. if you want to make it more efficient then you can easily add one more condition that will prompt the number 1 or 2 as prime. It is always better if you use your common sense. if(num==1 || num==2) printf("Not prime); else { //you may copy the existing code and check } All C programming videos: www.youtube.com/playlist?list=PLgH5QX0i9K3oyeTjSeouVTyLPgS28OoGm HSC ICT All videos : www.youtube.com/playlist?list=PLgH5QX0i9K3o8Y-CKhmyodbfHAc9VSVOv Subscribe : www.youtube.com/channel/UCEXwc6mNh7Lakj6lX-7a2Mg website : www.studywithanis.com Facebook : www.facebook.com/anisul2010s Facebook page : www.facebook.com/studywithanis/