473,498 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding a perfect number.

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.
5) Add up only the numbers that devide the original number evenly in
the array.
6) Compare the total of these to the original number and give a yes or
no answer.

I started it, and here is how its coming out:

int main (void)

{
int number, i, split, total;

printf("Enter number: ");
scanf("%d", &number);
for (i =0 ; i <= number; i++)
{
int array[number];

split = number - 1;
number = split;
array[number] = split;

printf("%d", array[number]); //just to check if the array
worked.
}
}

Obviously, this isn't even close to the solution, but i am getting
something, at least. Ofcourse, the program skips '1' and prints out
the rest up to only 5 digits. It won't 'split' the number any more.

Anyhow, any hints would be great.
Apr 28 '06 #1
19 4407
In article <mn***********************@mail.com>,
gk245 <to*****@mail.com> wrote:
Trying to write a program that will figure out if a number is perfect
or not.
That's really an algorithm question, not a question about C.
algorithm questions are more topical in comp.programming and
other similar newsgroups.
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
I don't understand what you mean by "split it up", and I do not
understand how (number - 1) (step 2) is going to give you the
several numbers you expect to use to populate the array in step 3.

4) Figure out if the original number is evenly divisible by any of the
numbers in the array.
5) Add up only the numbers that devide the original number evenly in
the array.
6) Compare the total of these to the original number and give a yes or
no answer.
[OT for comp.lang.C]

You can do noticably better than that.

A perfect number is always of the form (2**N-1)*(2**(N-1)) where
I am here using ** to denote exponentiation. So you can shift bits
of your trial number to the right until you find that the bottom bit
is no longer a zero, counting the number of shifts as you go.
If what is left over does not have exactly the same number of bits as
you shifted, and if those bits are not all 1's, then the number is not
perfect. If that condition is satisfied, then you can test the shifted
number to determine whether it is prime: if it is, then the original
is a perfect number.

For example,
6 = (2**2-1)*(2**(2-1)) = 3*2
28 = (2**3-1)*(2**(3-1)) = 7*4

I started it, and here is how its coming out: int main (void) {
int number, i, split, total;
printf("Enter number: ");
scanf("%d", &number);
for (i =0 ; i <= number; i++)
{
int array[number];
That syntax is valid in C99 but not in C89. C89 does not allow
declaration of arrays with a length which is dynamically determined.
(The closest C89 equivilent is to use malloc() or calloc() to dynamically
allocate the necessary memory.)

split = number - 1;
number = split;
array[number] = split;
None of these steps have involved your variable i, so you might
as well have done them outside of the loop instead of inside the loop.
(That would require moving the declaration of array.)

I am concerned that you are declaring your array to have number
elements in it, but you are looping (number+1) times: it hints that
whatever you are thinking of probably has an off-by-one error.

printf("%d", array[number]); //just to check if the array
worked. }
} Obviously, this isn't even close to the solution, but i am getting
something, at least. Ofcourse, the program skips '1' and prints out
the rest up to only 5 digits. It won't 'split' the number any more.


I don't know what you mean by "split" in this matter, but the "5 digits"
offers a clue as to a possible explanation.

Your variable number is declared as an int, and your scanf() format is
"%d" which is the appropriate format for an int. But what is the
maximum size of signed int that your implementation supports? If
your signed int happens to be 16 bits long, then 1 bit is {effectively}
needed for the sign and 15 bits for the value, which would give a maximum
possible int of 32767 (32768 in very obscure implementations.)
And 32767 happens to be exactly 5 digits long.

You could try changing to variables of type long and using a "%ld" format
for the scanf(). Be warned, though, that implementations often do not
allow large arrays to be declared in the C99 way your are proceeding,
so if you go much larger than 32768 you might find the program crashing
for lack of memory. The adjustment to make for that would be to
malloc() the necessary memory instead (after sanity-checking the
size of the number!).
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
Apr 28 '06 #2

gk245 wrote:
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.
5) Add up only the numbers that devide the original number evenly in
the array.
6) Compare the total of these to the original number and give a yes or
no answer.

I started it, and here is how its coming out:

int main (void)

{
int number, i, split, total;

printf("Enter number: ");
scanf("%d", &number);
for (i =0 ; i <= number; i++)
{
int array[number];

split = number - 1;
number = split;
array[number] = split;

printf("%d", array[number]); //just to check if the array
worked.
}
}

Obviously, this isn't even close to the solution, but i am getting
something, at least. Ofcourse, the program skips '1' and prints out
the rest up to only 5 digits. It won't 'split' the number any more.

Anyhow, any hints would be great.


A few observations:
1) it's not obvious what you mean by a "perfect number". I have no
interest in looking it up...
2) It's very odd that in your loop you are incrementing i and
decrementing number, so that the loop terminates when they meet half
way. I'm not sure that you intended that to happen.

Apr 28 '06 #3
Bill Pursell explained on 4/28/2006 :
gk245 wrote:
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.
5) Add up only the numbers that devide the original number evenly in
the array.
6) Compare the total of these to the original number and give a yes or
no answer.

I started it, and here is how its coming out:

int main (void)

{
int number, i, split, total;

printf("Enter number: ");
scanf("%d", &number);
for (i =0 ; i <= number; i++)
{
int array[number];

split = number - 1;
number = split;
array[number] = split;

printf("%d", array[number]); //just to check if the array
worked.
}
}

Obviously, this isn't even close to the solution, but i am getting
something, at least. Ofcourse, the program skips '1' and prints out
the rest up to only 5 digits. It won't 'split' the number any more.

Anyhow, any hints would be great.


A few observations:
1) it's not obvious what you mean by a "perfect number". I have no
interest in looking it up...
2) It's very odd that in your loop you are incrementing i and
decrementing number, so that the loop terminates when they meet half
way. I'm not sure that you intended that to happen.


Sorry, a perfect number is a number which in which its devisors (except
the number itself) add up to the original number. So, for example take
6. 6 can be "split-up" to 6,5,4,3,2,1. The devisors (which evenly
devide six,i.e: remainder is 0) here for 6 are 3, 2 and 1 (don't count
6 itself). 3, 2, and 1 add up to 6. So, 6 is a perfect number.
Apr 28 '06 #4

"gk245" <to*****@mail.com> wrote in message
news:mn***********************@mail.com...
Bill Pursell explained on 4/28/2006 :
gk245 wrote:
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.
5) Add up only the numbers that devide the original number evenly in
the array.
6) Compare the total of these to the original number and give a yes or
no answer.

I started it, and here is how its coming out:

int main (void)

{
int number, i, split, total;

printf("Enter number: ");
scanf("%d", &number);
for (i =0 ; i <= number; i++)
{
int array[number];

split = number - 1;
number = split;
array[number] = split;

printf("%d", array[number]); //just to check if the array
worked.
}
}

Obviously, this isn't even close to the solution, but i am getting
something, at least. Ofcourse, the program skips '1' and prints out
the rest up to only 5 digits. It won't 'split' the number any more.

Anyhow, any hints would be great.


A few observations:
1) it's not obvious what you mean by a "perfect number". I have no
interest in looking it up...
2) It's very odd that in your loop you are incrementing i and
decrementing number, so that the loop terminates when they meet half
way. I'm not sure that you intended that to happen.


Sorry, a perfect number is a number which in which its devisors (except
the number itself) add up to the original number. So, for example take 6.
6 can be "split-up" to 6,5,4,3,2,1. The devisors (which evenly devide
six,i.e: remainder is 0) here for 6 are 3, 2 and 1 (don't count 6 itself).
3, 2, and 1 add up to 6. So, 6 is a perfect number.


I suggest we #define devide divide
Joe
Apr 28 '06 #5
In article <e2**********@canopus.cc.umanitoba.ca>,
I, Walter Roberson <ro******@ibd.nrc-cnrc.gc.ca> wrote:
In article <mn***********************@mail.com>,
gk245 <to*****@mail.com> wrote:
split = number - 1;
number = split;
array[number] = split;

None of these steps have involved your variable i, so you might
as well have done them outside of the loop instead of inside the loop.
(That would require moving the declaration of array.)


Ignore that bit -- I missed that you were modifying number as you
went. But it's rather odd, that you keep reducing the size of the
array as you go...
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
Apr 28 '06 #6

"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.ca> wrote in message
news:e2**********@canopus.cc.umanitoba.ca...
In article <e2**********@canopus.cc.umanitoba.ca>,
I, Walter Roberson <ro******@ibd.nrc-cnrc.gc.ca> wrote:
In article <mn***********************@mail.com>,
gk245 <to*****@mail.com> wrote:

split = number - 1;
number = split;
array[number] = split;

None of these steps have involved your variable i, so you might
as well have done them outside of the loop instead of inside the loop.
(That would require moving the declaration of array.)


Ignore that bit -- I missed that you were modifying number as you
went. But it's rather odd, that you keep reducing the size of the
array as you go...
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell

[from earlier post]
That's really an algorithm question, not a question about C.

I disagree, as your reply made it into a question in C, a question I just
thought of for the duration of breakfast, and one which I would love to see
solved with the bit manipulations you mentioned. The lack of topicality is
from the OP's casual relationship with Funk and Wagnall's. Joe
Apr 28 '06 #7


gk245 wrote On 04/28/06 11:51,:
Trying to write a program that will figure out if a number is perfect
or not.

Here is my logic: [...]

Anyhow, any hints would be great.


Here are three, put as questions. If you ponder them
for a while, you may find them helpful:

- Is N divisible by N-1? More generally, what is the
largest integer that might be a divisor of a given
positive N? Still more generally, if U * V == N and
U <= V, what is the largest value U can possibly have?

- Why do you need an array? How many potential divisors
of a number do you need to have on hand simultaneously?

--
Er*********@sun.com

Apr 28 '06 #8
In article <44**********************@news.usenetmonster.com >,
Joe Smith <gr**********@netzero.net> wrote:
"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.ca> wrote in message
news:e2**********@canopus.cc.umanitoba.ca...
I, Walter Roberson <ro******@ibd.nrc-cnrc.gc.ca> wrote:
In article <mn***********************@mail.com>, That's really an algorithm question, not a question about C.
I disagree, as your reply made it into a question in C, a question I just
thought of for the duration of breakfast, and one which I would love to see
solved with the bit manipulations you mentioned.


Not really -- my reply was an algorithm implementable in C,
which is different than making it a C question.

The algorithm I gave was an outline of a method for testing an
arbitrary positive integer for perfectness. If one were trying to
generate perfect numbers, then one would make further use of the
fact that (2**N-1) {** denoting exponentiation} can only be prime
if N itself is prime. Numbers of the form 2**N-1 are known as
Mersenne Numbers, and have been extensively studied.

For more information on Mersenne primes, see
http://primes.utm.edu/mersenne/index.html
Note that only 43 of them are known so far (and therefor only 43
perfect numbers).

To participate in the search for perfect numbers, consider joining
GIMPS, the Great Internet Mersenne Prime Search by running
the Primenet software,
http://www.mersenne.org/prime.htm

Note: the scale of the numbers involved is *way* up there --
currently over 25 million bits (over 9 million decimal digits.)
You will not get very far on a perfect number search without
using much more advanced algorithms than I outlined.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Apr 28 '06 #9
"Joe Smith" <gr**********@netzero.net> writes:
"gk245" <to*****@mail.com> wrote in message
news:mn***********************@mail.com...

[58 lines deleted]
Sorry, a perfect number is a number which in which its devisors (except
the number itself) add up to the original number. So, for example take 6.
6 can be "split-up" to 6,5,4,3,2,1. The devisors (which evenly devide
six,i.e: remainder is 0) here for 6 are 3, 2 and 1 (don't count 6 itself).
3, 2, and 1 add up to 6. So, 6 is a perfect number.


I suggest we #define devide divide
Joe


Joe, was it really necessary to quote the entire article for the sake
of a spelling correction? Please snip whatever isn't relevant to your
followup.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Apr 28 '06 #10

"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
"Joe Smith" <gr**********@netzero.net> writes:
"gk245" <to*****@mail.com> wrote in message
news:mn***********************@mail.com... [58 lines deleted]

[about ten lines and three misspellings deleted]
I suggest we #define devide divide
Joe

Joe, was it really necessary to quote the entire article for the sake
of a spelling correction? Please snip whatever isn't relevant to your
followup.


The removal of the serial, grating misspelling in the post would amount to
an appropriate K&R exercise. I'm certain the answer to your question is no.
Joe
Apr 28 '06 #11
gk245 wrote:
Bill Pursell explained on 4/28/2006 :
gk245 wrote:
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.
5) Add up only the numbers that devide the original number evenly in
the array.
6) Compare the total of these to the original number and give a yes or
no answer.

I started it, and here is how its coming out:

int main (void)

{
int number, i, split, total;

printf("Enter number: ");
scanf("%d", &number);
for (i =0 ; i <= number; i++)
{
int array[number];

split = number - 1;
number = split;
array[number] = split;

printf("%d", array[number]); //just to check if the array
worked.
}
}

Obviously, this isn't even close to the solution, but i am getting
something, at least. Ofcourse, the program skips '1' and prints out
the rest up to only 5 digits. It won't 'split' the number any more.

Anyhow, any hints would be great.


A few observations:
1) it's not obvious what you mean by a "perfect number". I have no
interest in looking it up...
2) It's very odd that in your loop you are incrementing i and
decrementing number, so that the loop terminates when they meet half
way. I'm not sure that you intended that to happen.


Sorry, a perfect number is a number which in which its devisors (except
the number itself) add up to the original number. So, for example take
6. 6 can be "split-up" to 6,5,4,3,2,1. The devisors (which evenly
devide six,i.e: remainder is 0) here for 6 are 3, 2 and 1 (don't count 6
itself). 3, 2, and 1 add up to 6. So, 6 is a perfect number.


Well, you don't need to split it up that much; only those values x < n/2
are relevant, because no number can be evenly divided into more than its
half.

--
"Every prime number in a series as a joke
Made all the patterns clear when I took that final toke"
- - Andrew Poelstra <http://www.wpsoftware.net/blog>
Apr 28 '06 #12
If n is prime and (2^n - 1) is prime (i.e. a Mersenne prime), then
(2^(n-1)) (2^n - 1) is a perfect number.
The 39 known Mersenne prime exponents:

2 3 5 7 13 17 19 31 61 89
107 127 521 607 1279 2203 2281 3217 4253 4423
9689 9941 11213 19937 21701 23209 44497 86243 110503 132049
216091 756839 859433 1257787 1398269 2976221 3021377 6972593 13466917

(Note that there is no proof yet that there are no other Mersenne
primes between #37 and #39 other than #38.)

Perfect Number
Number of Digits
#1 1
#2 2
#3 3
#4 4
#5 8
#6 10
#7 12
#8 19
#9 37
#10 54
#11 65
#12 77
#13 314
#14 366
#15 770
#16 1,327
#17 1,373
#18 1,937
#19 2,561
#20 2,663
#21 5,834
#22 5,985
#23 6,751
#24 12,003
#25 13,066
#26 13,973
#27 26,790
#28 51,924
#29 66,530
#30 79,502
#31 130,100
#32 455,663
#33 517,435
#34 757,263
#35 841,842
#36 1,791,864
#37 1,819,050
#38 4,197,919
#39 8,107,892
I also have the list of the 39 known perfect numbers available, 8MB compressed.

--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91387-4454 96.37% of all statistics are made up
Apr 29 '06 #13
In article <0h********************************@4ax.com>,
Kevin D. Quitt <KQ****@IEEInc.com> wrote:
If n is prime and (2^n - 1) is prime (i.e. a Mersenne prime), then
(2^(n-1)) (2^n - 1) is a perfect number.
I believe I said that earlier.
The 39 known Mersenne prime exponents:
If you had followed the link I gave, you would have found 43:
http://primes.utm.edu/mersenne/index.html
2 3 5 7 13 17 19 31 61 89
107 127 521 607 1279 2203 2281 3217 4253 4423
9689 9941 11213 19937 21701 23209 44497 86243 110503 132049
216091 756839 859433 1257787 1398269 2976221 3021377 6972593 13466917
The additional known ones are 20996011 2036583 25964951 30402457
(Note that there is no proof yet that there are no other Mersenne
primes between #37 and #39 other than #38.)


http://www.mersenne.org/status.htm
"All exponents below 17,546,00 have been tested at least once".
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Apr 29 '06 #14

"Walter Roberson"
Joe Smith <gr**********@netzero.net> wrote:
"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.ca> wrote in message
news:e2**********@canopus.cc.umanitoba.ca...
I, Walter Roberson <ro******@ibd.nrc-cnrc.gc.ca> wrote:
In article <mn***********************@mail.com>,That's really an algorithm question, not a question about C.
I disagree, as your reply made it into a question in C, a question I just
thought of for the duration of breakfast, and one which I would love to
see
solved with the bit manipulations you mentioned.
Not really -- my reply was an algorithm implementable in C,
which is different than making it a C question. [Walter's assertion]

To participate in the search for perfect numbers, consider joining
GIMPS, the Great Internet Mersenne Prime Search by running
the Primenet software,
http://www.mersenne.org/prime.htm

Note: the scale of the numbers involved is *way* up there --
currently over 25 million bits (over 9 million decimal digits.)
You will not get very far on a perfect number search without
using much more advanced algorithms than I outlined.


Indeed.

[snip]

To retort properly requires, among other things, access to UC, which I do
not have. As I understand you, you claim that a sufficient condition for a
number to be 'imperfect' is easily determined by bit manipulations,
something as germane to C as good humor.

My serious misgiving is that the problem has not been stated to my
satisfaction. I suspect that I shall not have this problem after I activate
the above link. Joe

----------
Apr 29 '06 #15

Walter Roberson wrote:
A perfect number is always of the form (2**N-1)*(2**(N-1)) where


I think you mean "An even perfect number." The existence
of an odd perfect number is a long-standing open question.

Apr 29 '06 #16
In article <44***********************@news.usenetmonster.com> ,
Joe Smith <gr**********@netzero.net> wrote:

[with respect to an algorithm outline I posted earlier in the thread]
To retort properly requires, among other things, access to UC, which I do
not have.
UC? You don't have access to uppercase?? Unlimited computing?
Microcontrollers? University of California or Cincinnati or Canberra
or Canterbury?
As I understand you, you claim that a sufficient condition for a
number to be 'imperfect' is easily determined by bit manipulations,
something as germane to C as good humor.
No, the bit manipulations I described only get you as far as
reducing down to a number that you then have to determine the
primality of. There is no known test for primality that is
easily determined by bit manipulations.

My serious misgiving is that the problem has not been stated to my
satisfaction.


A perfect number is a number for which the sum of the unique factors
(including 1) is equal to the number itself. For example,
28 is divisible by 1, 2, 4, 7, and 14, and 1+2+4+7+14 = 28.

That's all there is to the definition.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Apr 30 '06 #17

"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.ca> wrote in message
news:e3**********@canopus.cc.umanitoba.ca...
In article <44***********************@news.usenetmonster.com> ,
Joe Smith <gr**********@netzero.net> wrote:

[with respect to an algorithm outline I posted earlier in the thread]
To retort properly requires, among other things, access to UC, which I do
not have.
UC? You don't have access to uppercase?? Unlimited computing?
Microcontrollers? University of California or Cincinnati or Canberra
or Canterbury?


Said connection has been established, so I have an informed feel for the
problem. I would never Feit too long about precisely which alma matters.
Indeed, I was thrilled to hear of a rising star in the alma that didn't
matter too much to me.
As I understand you, you claim that a sufficient condition for a
number to be 'imperfect' is easily determined by bit manipulations,
something as germane to C as good humor.


No, the bit manipulations I described only get you as far as
reducing down to a number that you then have to determine the
primality of. There is no known test for primality that is
easily determined by bit manipulations.


Interesting. Yet I would bet dollars to donuts that a brute force assault
on 'imperfection' would use the bit manipulations and then , with the usual
suspects, determine prime versus just a usda number.
[query for a precise statement of the problem]

A perfect number is a number for which the sum of the unique factors
(including 1) is equal to the number itself. For example,
28 is divisible by 1, 2, 4, 7, and 14, and 1+2+4+7+14 = 28.

That's all there is to the definition.


In the same conversation that empowered me to *feel* the problem, it was
stated that the divisors add to 2N. Joe

Apr 30 '06 #18
On Sat, 29 Apr 2006 03:48:06 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca (Walter Roberson)
wrote:
If you had followed the link I gave, you would have found 43:
http://primes.utm.edu/mersenne/index.html


Indeed - thanks. I've updated my lists of perfect numbers and mersenne primes.

--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91387-4454 96.37% of all statistics are made up
May 1 '06 #19

"Eric Sosman"
gk245 wrote On 04/28/06 11:51,:
Trying to write a program that will figure out if a number is perfect
or not.

Here is my logic: [...]

Anyhow, any hints would be great.

I might be the culprit whose insult chased away the OP, so
in the interest of follow-through:
Here are three, put as questions. If you ponder them
for a while, you may find them helpful:

- Is N divisible by N-1? Iff N ==2 More generally, what is the
largest integer that might be a divisor of a given
positive N? Still more generally, if U * V == N and
U <= V, what is the largest value U can possibly have?
Are U, V and N all positive integers?
- Why do you need an array? How many potential divisors
of a number do you need to have on hand simultaneously?


He needs a memory technique. Which, I dunno. Joe
May 1 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3785
by: Han | last post by:
Determining the pattern below has got my stumped. I have a page of HTML and need to find all occurrences of the following pattern: score=9999999999&amp; The number shown can be 5-10 characters...
8
14700
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...
4
8433
by: sathyashrayan | last post by:
(This is not a home work question) Dear group, I want a program to find one number between a set of natural number.A program to guess a number in between a Natural number set.This should be a...
9
2441
by: stevewy | last post by:
I am trying to write a function that will test all the checkboxes in a particular group of a form (it's a questionnaire), see whether more than three of them are ticked, and display a message if...
4
8089
by: The 1 | last post by:
Q-1 Can sm1 suggest a program to check whether a given no is perfect square or not?? Q-2 Also sm1 suggest a program to check whether a given no is perfect power or not?? * PEfect power is a no...
2
1785
by: giulyteh8 | last post by:
An integer number is said to be prefect number if its factors, including 1(but not the number itself), sum to the number. For example, 6 is a prefect number bcoz 6=1+2+3. Write a function called...
2
12666
by: wkid87 | last post by:
Using C# Microsft Visual C#, Console Application I'm needing help with the user entering in a number to tell if it perfect or not. I have the perfect number figure out. Here in the instruction: ...
12
2424
by: hipfunkyjive | last post by:
Basically my program has to find perfect numbers in a range 1- 1000 it works , kinda but it displays a few numbers that are not perfect for example the first Perfect numbers are : 6 28 496 my...
17
9290
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...
0
7125
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,...
0
7002
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...
0
7165
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,...
0
7203
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...
1
6885
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...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
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...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.