How to count numbers of repetitions in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coolindienc
    New Member
    • Aug 2006
    • 48

    How to count numbers of repetitions in C++

    Plz help me to find out how to count numbers of repetitions of loop and do output of it in C++.

    Andy
  • anupam
    New Member
    • Aug 2006
    • 12

    #2
    Make ur question clear

    Comment

    • D_C
      Contributor
      • Jun 2006
      • 293

      #3
      Is this what you mean?
      Code:
      int count = 0;
      while(...)
      {
        ...
        count++;
      }
      cout << count << endl;

      Comment

      • coolindienc
        New Member
        • Aug 2006
        • 48

        #4
        I wanted to know if there is a way to find out how many times loop was repeated before it was terminited. If a loop ran for 13 times before termination, then I want to output 13 as a result.

        Andy

        Comment

        • coolindienc
          New Member
          • Aug 2006
          • 48

          #5
          Originally posted by anupam
          Make ur question clear
          I wanted to know if there is a way to find out how many times loop was repeated before it was terminited. If a loop ran for 13 times before termination, then I want to output 13 as a result.

          Andy

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            D_C has already given you the answer earlier in this thread. Is there something about it you don't understand?

            Comment

            Working...