473,395 Members | 1,941 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,395 software developers and data experts.

output 6 values per line

How do I make my results from my program to show 6 values each line?

Expand|Select|Wrap|Line Numbers
  1. int main() {
  2.   int counter;
  3.  
  4.   counter = 100;
  5.   while (counter <= 150) {
  6.     cout << counter << endl;
  7.     counter = counter + 2;
  8.    }
  9.  
  10.   return 0
  11.   }
Oct 29 '10 #1
1 2337
Meetee
931 Expert Mod 512MB
I kind of understood your question but didn't understand your code. What I get is, you want to print like following in output:

1 2 3 4 5 6
7 8 9 10 11 12
.....
.....
and so on till 150.

If I am correct then you will have to put a loop which checks whether 6 values have been entered in each line or not. And then endl to print next line.
Oct 29 '10 #2

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

Similar topics

0
by: Benjamin Rutt | last post by:
I have a tkinter 'Text' and 'Scrollbar' connected and working normally. When a new line of text is inserted (because I'm monitoring an output stream), I'd like the text and scrollbar to be...
3
by: Kai Grossjohann | last post by:
Consider this frame definition: <html> <frameset rows="50%,50%"> <frame frameborder="0" src="one.html"> <frame frameborder="0" src="two.html"> </frameset> </html> And the two frames both...
2
by: Alex Campos | last post by:
Using vb.net - how can I find the current program name and line number as I am running through the code without there being an error.
6
by: RA | last post by:
Hi I have a windows form app and I need to execute a program when the user chooses an option. How do I start a program from code, with command line arguments and getting the return value from...
0
by: Codex | last post by:
I'm using VC++ in Visual Studio 2003 to write a .NET wrapper class which accesses some unmanaged c code. When debugging, I've noticed that sometimes the debugger won't show values of unmanaged...
1
by: Juan Romero | last post by:
Hey guys, I need to launch an external application, but I need to launch it with some command line arguments. Now the thing is that I need to launch it as a process. For example: Dim p As New...
1
by: Sean | last post by:
How do I make my VB 6 desktop program show up in the taskbar when it's running?
0
by: klfa | last post by:
Dear sir, i realy need help as soon as possible i am trying to make a program that help me in my work i have about five pc connected to my LAN what i am trying to do is to make a program in VB...
4
by: mickey22 | last post by:
Hi all, I have a function template that takes one argument i.e a float/int value and I want that argument to be passed as command line.I have build this program and it has no errors. Could...
2
by: phopman | last post by:
I have a beautiful, dynamic and very attractive front page: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); include '../../db.inc'; $id = intval( mysql_real_escape_string(...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.