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 ...

# 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

Related

PROGRAM FOR FINDING BIGGEST OF THREE NUMBERS

#include<stdio.h> #include<conio.h> void main() {  int a,b,c;  clrscr();  printf("\n enter a,b,c values");  scanf("%d%d%d",&a,&b,&c);  if(a&g...

PROGRAM FOR CONVERTING TEMPERATURE

#include<stdio.h> #include<conio.h> void main() {   int c;   float f;   clrscr();   printf("enter c value");   scanf("%d",&c);   f=1.8*c+32.0; ...

PROGRAM FOR CALCULATING SIMPLE INTREST

#include<stdio.h> #include<conio.h> void main() {   int p,t,r;   float si;   clrscr();   printf("enter p,t,r values");   scanf("%d%d%d",&p,&t,&am...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item