cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Lounge
Nested Loops Modulus
Nested Loops Modulus
Dec 3, 2014 at 1:29am UTC
Doctor1988
(20)
Good Evening good people!
I am new to C++ and i wanted to ask how could i create 1-3-5-3-1 using nested loops or modules, can someone plz give me an example, thank you
Dec 3, 2014 at 1:31am UTC
Little Bobby Tables
(1079)
you probably want to move this to the beginners section...
edit: some pseudo code:
foreach(iterator in [1, 3, 5, 3, 1]) echo(iterator, (iterator != end([1, 3, 5, 3, 1]) ?
"-"
:
""
);
im not sure why you would need nested for loops. you could also make the iterator +=2 until it hits 5 then go down
Last edited on
Dec 3, 2014 at 1:37am UTC
Dec 3, 2014 at 1:39am UTC
Doctor1988
(20)
1st i wanna say thank you for just responding, i am grateful but i did move to the beginner section which i truly i am, but can i show you what i have or can you give me a c++ code printing stars on diffrent lines in this order 1-3-5-3-1
Topic archived. No new replies allowed.