Program for print Perfect numbers with in given range
# include<stdio.h> #include<conio.h> void maim() { int i, j, s, e, sum ; clrscr(); printf ( “enter range start &...
https://www.computersprofessor.com/2016/06/program-for-print-perfect-numbers-with.html?m=0
# include<stdio.h>
#include<conio.h>
void maim()
{
int i, j, s, e, sum ;
clrscr();
printf ( “enter range start & end”);
scanf (%d% d", & s, & e);
for ( i = s , i < = e; i++)
sum=0;
for(j=1;j<=i/2;j++)
{
if ( i %j = = 0)
sum = sum + j;
}
if ( sum = = i)
printf ( “%d \n “, i);getch();
}
Out put:
enter range start & end 10 1000
28
496