473,503 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to print results in a table

18 New Member
I am writing a program and I need the user to type in a set value and my program should calculate various answers, I have done the program for the calculations but I do not know how to print the results in a table. Thanks for your help
Feb 16 '07 #1
2 14120
rajesh6695
96 New Member
simply You can use gottoxy() function which will take the cursor to that position of the screen then you print.....

You can try this simple code....

Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <conio.h>
  3. int main()
  4. {
  5.     int i,j,x,y,k,value;
  6.     clrscr();
  7.     k=0,value=1;
  8.     printf("1st Column\t\t2nd Column\t3rd Column");
  9.     x=2;
  10.     for(i=0;i<=2;i++)
  11.     {
  12.         for(j=1;j<=10;j++)
  13.         {
  14.             gotoxy(y,x);
  15.             printf("%d",value++);
  16.             x++;
  17.         }
  18.         y=(y+20);
  19.         x=2;
  20.     }
  21.     getch();
  22.     return 0;
  23. }
Feb 16 '07 #2
Ganon11
3,652 Recognized Expert Specialist
Do you mean how to format your output to look like a table? If so, check this site for a simple tutorial regarding manipulators of output.
Feb 16 '07 #3

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

Similar topics

4
2163
by: Aaron Reimann | last post by:
I am trying to build a table using results from a database query. Right now (code below), the code displays each result in a new <tr>. I am wanted to display 3 results in one <tr> </tr>, and then...
23
63612
by: stewart.midwinter | last post by:
No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two...
48
8606
by: David J Patrick | last post by:
I'm trying to rewrite the CSS used in http://s92415866.onlinehome.us/files/ScreenplayCSSv2.html. using the w3.org paged media standards as described at http://www.w3.org/TR/REC-CSS2/page.html ...
3
2100
by: James J. Besemer | last post by:
I would like to champion a proposed enhancement to Python. I describe the basic idea below, in order to gage community interest. Right now, it's only an idea, and I'm sure there's room for...
4
1463
by: AR123 | last post by:
In the field for employee contribution I want to have GBP and make sure that this prints out in the results email. How can I set it up so that the GBP display next to the value in the results email?...
4
4436
by: 848lu | last post by:
hi, i am trying to get my code to print HTML tables and other html tags but i get error right from the begining when i print a table, where within it there are more tables and then i print my results...
3
1892
by: NMarks | last post by:
Hello, I currently have a continous form that has a search field in the header. The search works without issue, but I want to be able to print a report based off the search results. All the...
3
2922
by: rajkumarpb | last post by:
Hi friends, I am new to this forum...But not for programming...I want a Print CSS File to be added in my page..OK.... Here is the page and i want you friends to help me create the CSS File...
2
2449
by: chuck gregory | last post by:
I am using a microsoft access 2002 (10.6771.6845) SP3 program and recently linked new table to one I have been using a long time, with a one (new table) to many (old table) relationship, which worked...
0
7204
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
7342
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
7464
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...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.