#include<math.h>
void main()
{
int i, n, sum, lim_low, lim_up;
clrscr();
printf(“nnt ENTER THE LOWER LIMIT…: “);
scanf(“%d”, &lim_low);
printf(“nnt ENTER THE UPPER LIMIT…: “);
scanf(“%d”, &lim_up);
printf(“nnt THE PERFECT NUMBER ARE..:”);
for(n=lim_low+1; n<lim_up; n++)
{
sum = 0;
for(i=1; i<n; i++)
if(n%i == 0)
sum = sum + i;
if (sum == n)
printf(“nnttt%d”,n);
}
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C Program to find the prime numbers between a given range
- C Program to find the prime numbers below a given number.
- C Program for Armstrong numbers
- C program to find the number of integers divisible by 5 between the given range N1 and N2, where N1 < N2 and are integers. Also find the sum of all these integer numbers that divisible by 5 and output the computed results
- C program to read N integers (zero, +ve and -ve) into an array A and to a) Find the sum of negative numbers b) Find the sum of positive numbers and c) Find the average of all input numbers Output the various results computed with proper headings
