#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,sum;
clrscr();
for(i=1;i<=500;i++)
{
j=1;
sum=0;
while(j<i)
{
if(i%j==0)
sum=sum+j;
j++;
}
if(sum==i)
printf("%d\n",i);
}
getch();
}
k
You can use the Math.sqrt() method.
no thanks
create a program that iterates until it finds a perfect number, then store that perfect number into an array. Continue iterating until you find three more. Then, you have an array of four perfect numbers.
Yes, do write, or if you're too lazy to your homework, use google.
Write your own prime number program and find out.
1. Get any no. 2. Find it factors. 3. Add its factor. 4. If sum of its factors is equal to itself then it is a perfect no. otherwise not
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
write a vb program to find the magic square
For first find an example program.
Write a program to find the grade obtained by the students of a class
Yes, do write. That's what you always have to do when you have got a homework-program.