 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
sej Guest
|
Posted: Thu Sep 29, 2005 2:14 pm Post subject: for loop |
|
|
hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
|
|
| Back to top |
|
 |
Howard Guest
|
Posted: Thu Sep 29, 2005 2:34 pm Post subject: Re: for loop |
|
|
"sej" <sweetsejal17 (AT) yahoo (DOT) co.in> wrote
| Quote: | hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
|
i m ok, thx. sugg: do ur own hmwrk. and spk englsh
|
|
| Back to top |
|
 |
mlimber Guest
|
Posted: Thu Sep 29, 2005 2:34 pm Post subject: Re: for loop |
|
|
sej wrote:
| Quote: | hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
|
See this FAQ and the one following:
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
Cheers! --M
|
|
| Back to top |
|
 |
Rolf Magnus Guest
|
Posted: Thu Sep 29, 2005 2:48 pm Post subject: Re: for loop |
|
|
sej wrote:
I'm not your buddy.
Pardon?
| Quote: | i cant able to write a program to print first k prfect number. perfect
number is the sum of all factor less than equal to tht number n which is
equal to tht number,for example 6 is perfect number, and its factor is
1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
|
So which part of that do you have problems with? Show us what you have so
far.
|
|
| Back to top |
|
 |
John Harrison Guest
|
Posted: Thu Sep 29, 2005 5:32 pm Post subject: Re: for loop |
|
|
sej wrote:
| Quote: | hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
|
OK, well first you have to write a function which returns true if n is a
perect number and false otherwise.
bool is_a_perfect_number(int n)
{
...
}
and then you have to call it in a loop (maybe a for loop) so that you
call the function for successive integers.
Maybe you would need a few other functions such as, return true if a is
a factor of b.
bool is_a_factor(int a, int b)
{
...
}
Make sense so far? Well this is called programming, so have a go and if
you get stuck post your code back here.
john
|
|
| Back to top |
|
 |
Derek Baker Guest
|
Posted: Fri Sep 30, 2005 7:25 am Post subject: Re: for loop |
|
|
Howard wrote:
| Quote: | "sej" <sweetsejal17 (AT) yahoo (DOT) co.in> wrote in message
news:1128003272.677756.319280 (AT) g14g2000cwa (DOT) googlegroups.com...
hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
i m ok, thx. sugg: do ur own hmwrk. and spk englsh
|
His email address is from India.
--
Derek
|
|
| Back to top |
|
 |
Howard Guest
|
Posted: Fri Sep 30, 2005 2:12 pm Post subject: Re: for loop |
|
|
"Derek Baker" <me (AT) derekbaker (DOT) eclipse.co.uk> wrote
| Quote: | Howard wrote:
"sej" <sweetsejal17 (AT) yahoo (DOT) co.in> wrote in message
news:1128003272.677756.319280 (AT) g14g2000cwa (DOT) googlegroups.com...
hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
i m ok, thx. sugg: do ur own hmwrk. and spk englsh
His email address is from India.
--
Derek
|
So? I'm not commenting on poor grammar or poor spelling, but the use of
phrases like "how r u?", "tht" for "that", and no capitalization to start
sentences. Those are not factors of his being from India, they're IM-speak,
the shorthand that (mostly) kids are using on their text messagers, etc.,
and it's annoying. In a field such as programming, why use such shorthand?
You can't program in shorthand, and if you want to communicate with others,
it's best to be clear.
"At least that's my opinion... I could be wrong."
-Howard
|
|
| Back to top |
|
 |
Jaspreet Guest
|
Posted: Fri Sep 30, 2005 7:56 pm Post subject: Re: for loop |
|
|
Derek Baker wrote:
| Quote: | Howard wrote:
"sej" <sweetsejal17 (AT) yahoo (DOT) co.in> wrote in message
news:1128003272.677756.319280 (AT) g14g2000cwa (DOT) googlegroups.com...
hello buddy.how r u? i cant able to write a program to print first k
prfect number. perfect number is the sum of all factor less than equal
to tht number n which is equal to tht number,for example 6 is perfect
number, and its factor is 1,2,3 and 1+2+3=6. try to help by tomm. bye
have a nice time.take care.
i m ok, thx. sugg: do ur own hmwrk. and spk englsh
His email address is from India.
--
Derek
|
So, what is that supposed to mean ? I am also from India. Please shed
some light on the cryptic sentence of yours.
The original post has nothing to do with the location. The fault lies
in the fact that 'sej' has used the same language he would have been
using in his IM world to post to a newsgroup.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|