C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

for loop

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
sej
Guest





PostPosted: Thu Sep 29, 2005 2:14 pm    Post subject: for loop Reply with 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.

Back to top
Howard
Guest





PostPosted: Thu Sep 29, 2005 2:34 pm    Post subject: Re: for loop Reply with quote




"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





PostPosted: Thu Sep 29, 2005 2:34 pm    Post subject: Re: for loop Reply with quote



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





PostPosted: Thu Sep 29, 2005 2:48 pm    Post subject: Re: for loop Reply with quote

sej wrote:

Quote:
hello buddy.

I'm not your buddy.

Quote:
how r u?

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





PostPosted: Thu Sep 29, 2005 5:32 pm    Post subject: Re: for loop Reply with quote

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





PostPosted: Fri Sep 30, 2005 7:25 am    Post subject: Re: for loop Reply with quote

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





PostPosted: Fri Sep 30, 2005 2:12 pm    Post subject: Re: for loop Reply with quote


"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





PostPosted: Fri Sep 30, 2005 7:56 pm    Post subject: Re: for loop Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.