# Introduction In this lab, you will learn how to write a C program to check if a given number is a perfect number. The program will read an integer input from the user, calculate the sum of its proper divisors, and then determine whether the number is perfect or not. The lab covers fundamental concepts in number theory and discrete mathematics, providing a practical application of these principles in C programming. The program first prompts the user to enter a positive integer, then calculates the sum of the number's proper divisors (i.e., all positive integers less than the number that divide the number evenly). Finally, the program compares the sum of the proper divisors to the original number and prints the result, indicating whether the number is perfect or not.
Click the virtual machine below to start practicing