Total members 10249 | Gratitudes |It is currently Thu May 17, 2012 7:44 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: C++ for loops
PostPosted: Fri Apr 08, 2011 2:29 am 
Offline
Newbie
User avatar

Joined: Fri Apr 08, 2011 2:20 am
Posts: 6
Has thanked: 5 time
Have thanks: 0 time

How do I write a for loop from 200 to 100, decremented by 4? So far I have: for (int n=200; n>99; ???????


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: C++ for loops
PostPosted: Fri Apr 08, 2011 10:46 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2272
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
code help ,
Code:
for(int i=200,i>100;i--)
{
/// do your work here. 
}
 


or
decrease by 4
Code:


for(int i=200,i>100;i-=4)
{
/// do your work here. 
}
 

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 C++ For Loops
 Nesting Two for Loops
 Break in Nested Loops
 Lets Learn C++----->(Lesson 4) Loops

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team