Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6986341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:47:47+00:00 2026-05-27T18:47:47+00:00

I am currently working on loops (for, while, and do while). I understand the

  • 0

I am currently working on loops (for, while, and do while). I understand the basics and have successfully been able to do the basics with little to no effort.
I am currently working on a problem that goes just a touch beyond the basics where the end result will show a message (“Pass {0} in the loop”) where obviously the “{0}” is the number loop. However, I am trying to create a separate message for those number that are divisible by 5 (5, 10,15,20). Could I get a pointer in the right direction. I played around with the ideas of using an “if” statement or even a “foreach”, but have had no luck since yesterday finding a possible viable option or simply did not know how to phrase it properly. Below is my current code:

    static void Main(string[] args)
    {
        int i = 1;
        Console.WriteLine("Do while loop positive numbers");

        do
        {
            Console.WriteLine("Pass {0} in the loop", i++);

        } while (i <= 20);

        Console.ReadLine();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:47:48+00:00Added an answer on May 27, 2026 at 6:47 pm

    Won’t write code for you but would like to give hint

    You can use an if condition inside the do while loop to check if it is divisible by 5 then display the special message. You can use % operator to check whether the number is divisible by some other number or not

     static void Main(string[] args)
        {
            int i = 1;
            Console.WriteLine("Do while loop positive numbers");
    
            do
            {
    
                Console.WriteLine("Pass {0} in the loop", i++);
                //if your number is divisible by 5 then display message 
            } while (i <= 20);
    
            Console.ReadLine();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on Mangler's Android implementation. I have a java class that looks
I'm currently working on two social networking sites that have a lot in common,
I am currently working on a while loop that should get the following information
I am currently working with a query in in MSSQL that looks like: SELECT
Am currently working on an application that requires users to submit posts and comments
I`m currently working on a script, and I have the following situation. function somnicefunction()
I'm currently working on an iPhone app and I have a library from a
I have a list of tasks that I allow a user to sort, currently
I have recently started using Vim as my text editor and am currently working
I'm currently working on a website that imports XML data that we download from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.