Learn how to write a C program to check whether a given number is prime or not using conditional logic and loops with full explanation and sample output.