473,657 Members | 2,479 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 14152
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
2179
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 create a new <tr> with another 3, etc. Here is human code: print a <tr> if only 1, 2 or 3 results have been returned, show the results and print a </tr> if 4, 5, and or 6 results have been returned, print <tr> and show
23
63665
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 vars, along with their names. I could easily do this: print "myPlace = %s, myTime = %s" % (myPlace, myTime)
48
8655
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 The ScreenplayCSS is flawed, for several reasons; -overuse of <div id= tags -doesn't scale screen resolutions (convert from px to in, pt ?) -no media="print" (how much coule be shared between "screen" & "print") -no automatic page breaks (with...
3
2105
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 improvement. And of course it's possible there's some serious "gotcha" I've overlooked. Thus I welcome any and all comments. If there's some agreement that this proposal is worth further consideration then I'll re-submit a formal document in...
4
1475
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? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Proforma</title> <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
4
4448
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 from queries. heres the code where it starts from print "<table cellpadding="0" cellspacing="0" border="0" align="center" >" for some reasons it dont let me, any comments?
3
1902
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 records have there own unique Record ID and they are all pulled from the same table. I know how to print a report based off 1 record, but I can't for the life of me figure out the above problem. Any help would be greatly appreciated.
3
2929
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 for the page i give here...Frankly said, i am a noob in CSS....Please help me....Here is my HTML Page and i want only the <div id="pageloader"> to be displayed.. <%@ page session="true" %> <%@ page import="java.util.*" %> <%@ page...
2
2457
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 fine when I created 22 forms linked to the original table and form. However, I wanted to have the pirmary key numbers posted in both tables at the same time. So, I opened the original table's query, linked the two tables in it, and dragged the...
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1734
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.