- #1
stevenviney
- 3
- 0
i need to write a program that sets up a table displaying values of n, sqrt n and ln n from n = 0 - nmax. I've prompted the user to enter a value for integer nmax. but then I've no idea how to make this apply for the value for nmax for my table.
this is what i have so far
how can i make nmax apply to the n i choose? and how can I set it up in a table which is displayed? I've spent hours and hours, I am sorry, I am so bad at this...
all i get out is 0x22cbd...
this is what i have so far
Code:
//Problem Sheet 2 Table
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
const int numRows = n;
const int numColumns = 3;
double table[numRows][numColumns];
cout <<"This program will setup a table with values up to an integer n. Please enter your desired maximum integer n:"<< endl;
cin >> n;
cout <<table;
return 0;
}
how can i make nmax apply to the n i choose? and how can I set it up in a table which is displayed? I've spent hours and hours, I am sorry, I am so bad at this...
all i get out is 0x22cbd...