cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Basic For loop
Basic For loop
Aug 28, 2013 at 6:45am UTC
colognem
(29)
Is it possible in for loop that the initial value of x, for example, is 1 and when it loops back x will be 2 then will be 1 again in next loop? and i will also be the one to choose if how many times they will be shown alternately.
Last edited on
Aug 28, 2013 at 6:57am UTC
Aug 28, 2013 at 7:01am UTC
metulburr
(585)
Is it possible in for loop that the initial value of x, for example, is 1 and when it loops back x will be 2 then will be 1 again in next loop?
that just sounds like an infinite loop
and i will also be the one to choose if how many times they will be shown alternately.
with a counter
Aug 28, 2013 at 7:20am UTC
colognem
(29)
i'm asking that because i'm trying to make a tic tac toe game. and the players turn are alternate ..
Aug 28, 2013 at 7:34am UTC
manudude03
(88)
x=(x%2)+1;
Aug 28, 2013 at 7:38am UTC
colognem
(29)
thanks bro !
Topic archived. No new replies allowed.