Chapter:

C-programs-on-various-integers

C Program to Check wher a given Number is Perfect Number:

This is a C Program to check whether a given number is perfect number.

Program Description:

This C Program checks whether a given number is perfect number.

Problem Solution

Perfect number is a number which is equal to sum of its divisor. For eg, divisors of 6 are 1,2 and 3. The sum of these divisors is 6. So 6 is called as a perfect number.

Program/Source Code

/*

 * C Program to Check whether a given Number is Perfect Number

 */

#include <stdio.h>

 

int main()

{

    int number, rem, sum = 0, i;

 

    printf("Enter a Number\n");

    scanf("%d", &number);

    for (i = 1; i <= (number - 1); i++)

 &nbs....Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-