Switch to full style
For C/C++ coders discussions and solutions
Post a reply

I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER

Wed Apr 22, 2009 4:34 pm

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 .. :) !! :gOOd:



Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER

Fri Apr 24, 2009 10:18 am

I think u can write for loop for your logic like this
Code:
for(int i=5;i<=31;i+2)
{
printf("%d",i);
i++;


Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER

Fri Apr 24, 2009 8:29 pm

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.

Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER

Sat Apr 25, 2009 2:28 pm

:blush: thanks fellows for ur help , !! but i really need some professional's help here :S :( ....

would i find some!

Re: I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER

Tue Apr 28, 2009 12:20 am

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

Post a reply
  Related Posts  to : I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
 Beginner help on includes     -  
 Hi im a beginner in java im facing problem please help me     -  
 Beginner needs help- simple 'mail_to' contact form in PHP     -  
 Do while loop     -  
 do while loop and for loop C++ example help.     -  
 While loop     -  
 C++ While loop     -  
 Why will my loop does not work     -  
 Using include() Within a Loop     -  
 PIC Assembly For Loop Example     -