473,513 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Squares Cube Table

1 New Member
Hey I'm trying to make a table that ask users to enter a low number and high number. The program should calculate the square and cube for all number between the low and high. However my code won't compile. Any help?

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. using namespace std;
  5.  
  6. int main()
  7.  
  8. {
  9.   string mystr;
  10.   int high=0;
  11.   int low=0;
  12.   int i=low;
  13.  
  14.   cout << "Math Table /n";    
  15.   cout << "Enter low number: ";
  16.   getline (cin,mystr);
  17.   stringstream(mystr) >> low;
  18.   cout << "Enter High number: " ;
  19.   getline (cin,mystr);
  20.   stringstream(mystr) >> high;
  21.  
  22. for (low < high)
  23.     printf("%8dNumber %8dSquare %8dCube\n ", i, i * i, i * i * i) ;
  24.  
  25. return 0;
  26. }
Aug 4 '08 #1
3 2896
oler1s
671 Recognized Expert Contributor
However my code won't compile
Did you conclude that your code doesn't compile because you get a compiler error? It would be useful to copy-paste the error messages here, so we can read them and figure out what is wrong.

Also, error messages contain a message, as the name suggests. We usually fix them by reading them, which indicate what is wrong in our program. The expectation is that you too can read an error message and fix your program, so if you cannot fix your program, tell us why. Could you not understand the error message? Did you understand it, but not see what in your code could have caused the error?

We want you to learn, but if all you ask for is "fix my code", then you aren't learning, really.
Aug 4 '08 #2
etiainen
40 New Member
oops, I almost gave him an answer... How do I delete a post btw?
Aug 4 '08 #3
Laharl
849 Recognized Expert Contributor
You don't, only mods/admins can do that.
Aug 4 '08 #4

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

Similar topics

6
3642
by: binger | last post by:
Okay, Superbowl is only a few days away, but I thought it would be cool to set up an online registration for a football squares pool. My thoughts are to have people go into anywhere on the 10x10...
3
27905
by: Biswajit Barik | last post by:
Hi All, I want to create a cube using MSSQL2000 i dont know any thing how to create and what is parameter required so if any body help me i will be thankfull to him/her.For information : i have 4...
2
1490
by: SRL | last post by:
Hi, This is probably a classic scenario with a shared dimension that we need to use in different cubes, where all fact tables do not offer the same level of detail. Dimension is snow-flaked. ...
0
1181
by: Wojtek Jurek | last post by:
I have installed DB2 Cube Views. What should I do to be able to view cube created in Cube Views in MS Office 2003? In OLAP sources for Pivot Table I can see only cubes made in Microsoft tools....
0
1792
by: Fan Ruo Xin | last post by:
I installed Stinger in my PC (w2k). I need to do a quick compare between DB2 OLAP server and DB2 Cube Views. And I only found DB2 Cube Views version8.1 trial code from IBM website. I didn't want to...
2
9514
by: johnywalkyra | last post by:
Hello, first of all sorry for crossposting, but I could not decide which group is more appropriate. To my question: Recently I've came across the code in GCC standard library, which computes the...
0
1409
by: Dip | last post by:
Hello Experts, I was wondering whether it is possible to create "Cube Roles" automatically. I have a table name called tblUsers which has "ProjectID" and "EmployeeID". Employees are allocated...
10
4605
by: wazzup | last post by:
C++ is new to me and I'm trying solve this problem but get stuck. Please help me out. Below is the task and after that is what i got so far. Create a program to print nested squares Input:...
10
13334
by: Nkhosinathie | last post by:
hello everyone may someone please help me with this c++ program. i'm developing a program that will print numbers from 0 to 10 which must appear like a table but i;m only allowed to use if...
0
7157
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...
0
7521
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...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
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...
0
3232
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
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
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
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
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.