• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

simple question

I have a for loop that counts to a given number.
I have to stop at every time the count reaches 12.
12,24 ,36 etc.
for(int i=0;i<count;i++)
{
 if(i==12)
  {
  cout<<"test"; //this is what started out with.
  }
}
Please help.
Thank you
0
strmtrpr
Asked:
strmtrpr
1 Solution
 
vmehroCommented:
if (i%12 == 0) will take care of 12 and multiples of 12.


0
 
strmtrprAuthor Commented:
Thank you very much.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now