473,568 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Program to determine perfect numbers

2 New Member
create a program that will let the user to enter a number..determi ne if the number is perfect or not...
e.g
6 is perfect # bec. its factors are 1,2,3 and 6.
1+2+3+6-6=6
6=6
Oct 7 '07 #1
2 2378
JosAH
11,448 Recognized Expert MVP
Do you know how to decide whether or not 'i' is a factor of 'n'? If so, make 'i'
your loop counter and you're in business.

kind regards,

Jos
Oct 7 '07 #2
bindiya182003
16 New Member
Is this what u really wanted?????
Oct 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
14709
by: | last post by:
I have to write a program that displays all of the perfect numbers less than 1000. I know I need 2 for loops and at least one if statement. What I need to know is, is there any method in Java to test if a number is perfect? Thanks.
22
3580
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html Newsgroup Readers: If you circulate copies of this report to groups of computer programmers at different universities etc. around the world then they might...
6
4950
by: hoover_richard | last post by:
I am a newbie to C++ and I need help with a simple program I am trying to write. My program is designed to print all of the odd integers contained in an array and output the sum of the odd integers. My code is listed below, but the problem is that my output of sum is wrong. For example, I am using 1347830 for my integers and the program...
6
7293
by: Rafael | last post by:
Hi Everyone, I need some help with my calculator program. I need my program to do 2 arguments and a 3rd, but the 3rd with different operators. Any help would be great. Here is my code.... #include <stdio.h> #include <stdlib.h>
19
4423
by: gk245 | last post by:
Trying to write a program that will figure out if a number is perfect or not. Here is my logic: 1) Read in the number 2) Split it up (number - 1) 3) Put all the split up numbers into an array 4) Figure out if the original number is evenly divisible by any of the numbers in the array.
18
3114
by: ben.carbery | last post by:
Hi, I have just written a simple program to get me started in C that calculates the number of days since your birthdate. One thing that confuses me about the program (even though it works) is how global variables and function returns work... For example, I have a global array "char datestring;" which is defined in the function speakdate....
9
4523
by: Hemal | last post by:
Hi All, I need to know the memory required by a c program. Is there any tool/utility which can give me the memory usage in terms of DATA segment, TEXT segment, BSS segment etc. I am working on linux platform and my target is ARM processor. But i guess it should not matter. Actually i need to know both RAM & ROM usage.
1
1536
by: buomque | last post by:
I'm writing a program that determine if that is prime or perfect numbers and output factors of them. If 6 is the first input, the output will say it's a perfect number but if i input 6 again it says 6 is not a prime. Could use some help here. Thanks! #include <iostream> using namespace std; int main () { int num, range=1000; int...
17
9298
by: nickels | last post by:
-Alright im supposed to make a program that tests for perfect numbers. I have to use 2 methods and 3 methods if you count the main method. -My first method has to return a boolean value of true or false if the argument is or isn't a perfect number. I found that all perfect numbers either end in a 6 or an 8 so i was thinking i could just use...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.