How we can make multiple counters? The first counter should count from 1 to 10 and the second counter should count from 4 to 20.
Is it possible (Using For or While methods)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not clear if you mean the loops should be nested or sequential. Here’s how to do nested loops using
for:The inner loop can, of course, also exist independently.
You can also do either or both loops using
while:(The inner loop can also be changed to a
whileloop if you like.)