Thank you all got what I needed...
Type: Posts; User: ninety3gd
Thank you all got what I needed...
Question about the expressions below:
cout << 17 / 3.0 << endl;
cout << 12.0 / 6 << endl;
5.66667
2
I realize about / and integer but why do I get an double result for the first...
Finally back at looking through code...I am trying to eliminate the gotos in the sudoku function below:
I have eliminated simple gotos before...
double sum = 0.0;
int x = 1;
...
You can use % with C# or Java with real values...
Well I have a sudoku solver- in C++ that finds one, many, or no solutions...bad thing is the input I would have to type in by hand...unless I read it in a text file....
CH is correct- trunc is available in C99 standard:
trunc- Truncate to nearest integral value:
double trunc(double x);
returns x rounded to the integer nearest to it but no larger in magnitude
I always thought that if the values are integer and positive the would both return the same value...but that is the only time that is the case...
(int) floor (1.1) = 1
(int)1.1 = 1
If they...
Nope, just pointing out that fact...Allready finished school-good exercise though
Doesn't look like your finished...still need to print the final product result...which you do not seem to have...
A you trying numerical differentiation..if so.
I would test that with some tolerance level:
tolerance a very small number
enter desired tolerance
...
while (tolExceded && something)
Go it to work- used the loop as sugguested...
Trying to eliminate a goto: from Schaums C++ book
double sum = 0.0;
int x = 1;
repeat: sum += 1.0 / x++;
if (x <= N)
goto repeat;
figured out my problem- thanks for all of the insight
Kind of an offshoot of my previous post but this has to do with logarithmic properties
Change of base:
logbX = logaX/logaB
and
logb(X/Y ) = logbX - logbY
Got it bithub...I just what look right from the texts on the matter
Forgot to find the parameter problem..and the caveat about getline...
here is how I would use a string with a struct;
struct exam
{
string name;
};
int main()
{
Sorry got my C/C++ confused- as mention needed to fix
struct a
{
char name[50];
int i;
};
int main(void)
All thought I am brushing back up on C/C++ I would try to solve the problem without using pointers- then make change to pointers
struct a
{
char name[50];
int i;
}
int main(void)
I would try the following- change...
string user_information ( string name1, string name2)
{
cout << "Please give me your first name ";
cin >> name1;
cout << "Please give me your last...
Basically I trying to find an all purpose formula- derived from the following..
A loop where the loop control body is multiplied or divided...
for (i = m; i < n; i *= x)
do something
If the...
Help with math calc
Calculating efficiency of loops from both
Gilberg and Hortsmann books...
Logarithmic Loops (multiplication and division):
Do you have a textbook or use other sources to help as well?
//eliminate the coefficients of X(I)
for (i = k + 1; i < n; i++)
{
mult = a[i][k] / a[k][k];
b[i] = b[i] - b[k] * mult; //compute constants
for (j = k; j < n; j++) //compute...
Have the following Gauss Elim code from text:
Not printing out correct code:
SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
USING GAUSSIAN ELIMINATION
This program uses...
Getting the off by a penny problem...
Enter an amount in double, for example 11.56: 12.35
Your amount 12.35 consists of
12 dollars
1 quarters
0 dimes
1 nickels
4 pennies