Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

loops

Posted on 1998-12-13
2
222 Views
Last Modified: 2010-04-02
I have a for loop to output a table
for(int i=0;i<=table;i++)

now I want to stop if i=12 and print out some data

then continue for rest of the count of i.

thanks for the help.
0
Comment
Question by:strmtrpr
2 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 20 total points
ID: 1180046
for (int i=0;i<=table;i++)
{
     if (i == 12)
        cout << "i == 12!";
    // other stuff
}

let me know if you have questions.
0
 

Author Comment

by:strmtrpr
ID: 1180047
I forgot the == I tried it with i=12;

thanks for the help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question