473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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
Aug 25 '06 #1
5 3638
anupam
12
Make ur question clear
Aug 25 '06 #2
D_C
293 100+
Is this what you mean?
Expand|Select|Wrap|Line Numbers
  1. int count = 0;
  2. while(...)
  3. {
  4.   ...
  5.   count++;
  6. }
  7. cout << count << endl;
Aug 25 '06 #3
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
Aug 26 '06 #4
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
Aug 26 '06 #5
Banfa
9,065 Expert Mod 8TB
D_C has already given you the answer earlier in this thread. Is there something about it you don't understand?
Aug 26 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: knoak | last post by:
Hi there, I have a small question: I have a table with lots of rows in it. Of course all have a different id, but each can be assigned to a certain category. Categories correspond with 1 - 10....
2
by: DrewKull | last post by:
Ok ... so I'm looking at a query where im trying to show a bunch of columns counted up based on criteria ... So far i've been able to count all the rows up and show them ... and also count up...
2
by: bearophileHUGS | last post by:
itertools.count docs say: Does not currently support python long integers. Note, count() does not check for overflow and will return negative numbers after exceeding sys.maxint. This behavior may...
3
by: wangerman | last post by:
#include <stdio.h> int main() { float a={.02, .05, .055, .01}; int i; for (i=0; i<=300; i++) if (a>0.4 && a<0.6) count++ printf("There are %d numbers between .4 and .6\n", some code???);...
2
by: nick048 | last post by:
Hi, I am a new user of C++ and I am learning this language. I want to resolve this example: 1) I have an indefinite sequence of integer (from 0 to 36) as Input; 2) I want to know the maximum...
17
by: Xoomer | last post by:
Hi, Can some post a code with simple Unique Random Numbers. Random numbers stored in arr but unique.
9
by: MLH | last post by:
A mailing list table in its virgin state contained sequential, consecutive integers in an autonumber field (A97). I've deleted records throughout the table. Now I would like to identify each...
41
by: Zytan | last post by:
Anyone do any tests on it? I would assume it has improved since C's rand(), but who knows. For some reason, and it could just be coincidence, I seem to see patterns. But even a crappy rand()...
14
by: zufie | last post by:
I have to create a QA report regarding callers calling into a phone hotline. The report consists of many checkboxes such as: Did the IBCCP agency contact you? Yes/NO How many days passed...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.