Computer problems,Computer help
*AX SOFT>>>Programming & Design

How can i make a counter appear in the next line at a certain number in c++?


i want to know how to cut a running counter in another line.
for example i made a counter in c++ that is up to 31, then in the first line i want to make 1-5 appear then cut then make the 6 above appear in next line? thanks in advance

in every line, there is no specific numbers of numbers to be viewed but the maximum is 7, will it wok there?

Assuming your counter starts at zero:

if (!(count % 5)) printf("\r\n");

Just add that line into your loop (changing 'count' to whatever your variable name is)

if your counter starts at 1, then try:
if (!((count+1) % 5)) printf("\r\n");

This will just output a new-line every time (count/5) leaves a remainer of zero. You may prefer to use cout instead of printf - doesn't make much difference.

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • I have gamemaker 4 from yoygames. is it still ok to distribute games made with gm4?

    Yes and no. Your actual rights are stipulated in the Game Maker Software end user licence agreement and the Yoyogames.com website. If you upload your GM game to Yoyogames.com, they "can use ...

  • Whats the code for making a java applet (picture) which uses: a semi-oval, oval, circle, rectangle, and line?

    There are a number of ways to accomplish this. The solution depends on if you're wanting to use AWT, Graphics2D, JFC Swing, or even a non-standard library. The shortest number of code lines...

  • Image storage?

    I dont know in coldFusion but in i know in PHP. Just save image location in your server to Mysql. For example i have me.jpg, in my localhost field "location" and the value is c://windows/...

  • Need help with designing a flash website, anyone up for it?

    You can post your project requirement at freelance website like ...

  • Can i extract the code of a program even if it is in the .exe form?? if yes then how can i do it??

    Yes you can... You can extract the code from the executable files or binary files by using programs called decompilers... They do the reverse job of Compilers... Ofcourse most of the readabi...

  • Can i extract the code of a program in vb6 even if it is in the .exe form?? if yes then how can i do it??

    The code in the exe isn't VB, it's machine code. You can extract the assembly version of the machine code by using a disassembler, but it won't do you any good unless you understand...

  • Running JAVA games on computer!?

    have a look at these search results ...

  • Can any one tell me how I can do a program for my dental clinic database?

    i dont think you are a programmer. If not, please dont try it. Out source your work to some offshore programmer in india. you will get high quality software in low price. I am asoftware developer. ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster