Question subject: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
Posted: Wed Apr 22, 2009 4:34 pm
Joined: Wed Apr 22, 2009 4:26 pm Posts: 2 Has thanked: 0 time Have thanks: 0 time
Please guys i need ur help wiz that .... am kinda a beginner in c++ ..
and i need to write that program with JUST " ONE " FOR LOOP that outputs these sequence of numbers
" 6 8 11 15 16 21 22 26 29 31 "
any help would be really appreciated .. !!
sureshbabu
Question subject: Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
Posted: Fri Apr 24, 2009 10:18 am
Joined: Fri Apr 24, 2009 9:56 am Posts: 1 Has thanked: 0 time Have thanks: 0 time
I think u can write for loop for your logic like this for(int i=5;i<=31;i+2) { printf("%d",i); i++; }
trekie86
Question subject: Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
Posted: Fri Apr 24, 2009 8:29 pm
Joined: Fri Apr 24, 2009 8:17 pm Posts: 2 Location: Colorado Springs, CO USA Has thanked: 0 time Have thanks: 0 time
sureshbabu,
Your code would return the following sequence: 5 8 11 14 17 20 23 26 29. It is essentially
Code:
for(int i=5; i<=31; i+3) {...}
I wish I could figure out the sequence for you. Sorry.
sheeko911
Question subject: Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
Posted: Sat Apr 25, 2009 2:28 pm
Joined: Wed Apr 22, 2009 4:26 pm Posts: 2 Has thanked: 0 time Have thanks: 0 time
thanks fellows for ur help , !! but i really need some professional's help here :S ....
would i find some!
biskot188
Question subject: Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
Posted: Tue Apr 28, 2009 12:20 am
Joined: Fri Nov 21, 2008 6:18 pm Posts: 51 Location: thessaloniki Has thanked: 0 time Have thanks: 2 time
think a number for exaple a gcd between those numbers and think how you gonna make the div with it so you get that numbers this is one way.just a thought ...make an effort
_________________ if you want make an effort yourself no one will make it for you... best regards