how can I output 123454321, if i input 5. and 1234321 if i input 4?
needhelpe
-5
Newbie Poster
Recommended Answers
Jump to Postuse a loop that counts from 1 to the number you enter, then another loop that counts backwards back down to 1. Print the loop counter.
Jump to PostOk here we go:
- you're missing the semi-colon after your declaration of the variable n.
- you haven't declared the variables i and count. And you don't need the count variable. Just print the value of i.
- remove the semi-colons from the end of your ā¦
All 12 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Gaiety
1
Junior Poster
mrnutty
761
Senior Poster
needhelpe
-5
Newbie Poster
yellowSnow
607
Posting Whiz in Training
Ali Shah Ahmed
-4
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Ali Shah Ahmed
-4
Newbie Poster
Salem
5,138
Posting Sage
Ali Shah Ahmed
-4
Newbie Poster
Salem
commented:
No problem - you didn't learn anything
-4
Rajkumar#T
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Ancient Dragon
commented:
LOL
+34
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.