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 8596285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:38:24+00:00 2026-06-12T00:38:24+00:00

I am trying to finish this method for quite some time ,but I am

  • 0

I am trying to finish this method for quite some time ,but I am a bit stuck. I am trying to make it where the slog will go 1,2,3,4,beep instead of what it is doing currently 1,2,3,4,5,beep,6. I was wondering how to perform such a method.There is more to my code ,but I will put the essential code up.(p.s.) I did a lot more to try to solve this, so I post basic code for everyone to understand.

-(IBAction)setmethod:(id)sender{
   for (int k=1;i<=20;k++){
       NSLog( @"%d",k);                
       if(k % 5 == 0) { NSLog( @"beep");
  • 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-06-12T00:38:26+00:00Added an answer on June 12, 2026 at 12:38 am

    You can simply move 1st NSLog to the else case:

    for (int k=1;i<=20;k++){    
        if(k % 5 == 0) { 
           NSLog( @"beep");
        }
        else{
           NSLog( @"%d",k);                
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to finish a smoosh() method which will takes an array of
i having some hard time on this, i'm trying to get my first WP7
Ok, so I'm trying to finish our simple project for Data Strcutures but there
I was trying to create a lzw compression program. But i need to finish
I have written a method that downloads some files, and now I'm trying to
I'm trying to finish my class which extends FragmentActivity from a static method:- private
I am trying to finish a project. I am working with user models. When
I'm trying to finish my project with Python and PyQt4 and I'm having an
I've been trying to finish up a web scraper for a website of mine
I am trying to finish writting my news/blog ASP.net C# application and I am

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.