HTML code to create a Analog Clock
printf("Enter a number:");
printf("%d is a perfect number",number);
printf("%d is not a perfect number",number);
The above program will print that whether the given number is perfect or not. . The program takes an integer value from user and assigns that value in the variable 'number' and further it assigns a number one-less than the value present in number variable in another variable num. While loop will be executed till the num does not become less than 0.In the loop we will calculate the sum of the positive factors of the given number. If their sum including 1 is equal to number then the number is perfect otherwise not. We can understand this process with the help of given example:
so number 6 is a perfect number.