473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can someone please tell me where I am going wrong??

I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...

Here is what I have so far and can't figure out what i'm doing wrong.
any help would be greatly appreciated, thanks guys...

#include <stdio.h>
#include <math.h>

int main() {

int i,n;
double x;
float sum, term;

printf("Enter a number in the interval [1,2]");
scanf("%d", &x);

sum = 0;
i = 0;

do {
i = i+1;
x = (double) i;
term = pow(x, i)/i;
if(i % 2 == 1)
sum = sum + term;
else
sum = sum - term;

} while(i <= n);

printf("The answer is %lf\n",sum);

Mar 5 '07 #1
15 2648
E-Dot wrote:
I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...

Here is what I have so far and can't figure out what i'm doing wrong.
any help would be greatly appreciated, thanks guys...

#include <stdio.h>
#include <math.h>

int main() {
If main is not going to accept command line parameters, specify void.
int i,n;
double x;
float sum, term;
Why not make sum and term double as well?
printf("Enter a number in the interval [1,2]");
Either end the printf string with a newline or call fflush(stdout)
just after printf. Otherwise, your output may appear delayed because
of buffering.
scanf("%d", &x);
You're telling scanf to look for a decimal integer value and store it
into a double object. Are you sure that this is what you want?
sum = 0;
i = 0;

do {
i = i+1;
x = (double) i;
And you're overwriting your previous value in x.
term = pow(x, i)/i;
Here x and i will have the same value due to your previous assignment.
if(i % 2 == 1)
sum = sum + term;
else
sum = sum - term;

} while(i <= n);
You're comparing i against an uninitialised value, (n); Undefined
behaviour.
printf("The answer is %lf\n",sum);
For printing a float-point object use the %f format specifier. The %lf
format specifier was added with C99, as an alternative, but many
compilers don't yet fully support it.

Mar 5 '07 #2
E-Dot wrote:
I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...
it would be better if you posted all of the assignment.

Here is what I have so far and can't figure out what i'm doing wrong.
perhaps if you said what the symptom was... What is going wrong?

#include <stdio.h>
#include <math.h>

int main() {

int i,n;
double x;
float sum, term;

printf("Enter a number in the interval [1,2]");
scanf("%d", &x);

sum = 0;
i = 0;

do {
i = i+1;
could use (same result, but less to type)
i++;
x = (double) i;
term = pow(x, i)/i;
you can avoid calling pow() in the loop. What is the difference
between pow(x,i) and pow(x,i+1), is there a pattern?
if(i % 2 == 1)
sum = sum + term;
or
sum += term;
else
sum = sum - term;

} while(i <= n);
this isn't going to give you six decimal places is it?
And n is not initialised.
>
printf("The answer is %lf\n",sum);
if you did what the assignment said and printed x, sum and log(x)
you might have been able to debug this yourself (x would be wrong)
--
Nick Keighley

Mar 6 '07 #3

Nick Keighley wrote:
E-Dot wrote:
I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...
note that's log(x + 1), not log(x)...

<snip>

--
Nick Keighley

Mar 6 '07 #4
"E-Dot" writes:
>I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...
<snip>

You are still fighting basic I/0 instead of the thing your instructor is
dwelling on. I/O, in any language, is a bitch, plain and simple. You seem
to have tried so here is a skeleton you should be able to use as a test rig.
The stuff just before return 3.1416 needs a bit of refinement, which I will
leave to you. The getchar() sprinkled around are to make life simpler when
debugging with the compiler I happen to use. You may not need them.

#include <stdio.h>
#include <stdlib.h /* exit() */

double ln(double x)
{
if( x<-1 || x>+1)
{
printf("Argument provided to function ln out of range.\nAborting\n");
fflush(NULL);
getchar();
getchar();
exit(-1);
}
/* Need something here ... */
return 3.1416;
}
/******************/
int main(void)
{
double z, y;
printf("Enter a decimal number in the range 1..2\n");
scanf("%lf", &z);
y = ln(z-1);
printf("Natural log of %f is %f\n", z, y);
fflush(NULL);
getchar();
getchar();
return 0;
}
Mar 6 '07 #5
On Mar 6, 3:16 am, "Nick Keighley" <nick_keighley_nos...@hotmail.com>
wrote:
Nick Keighley wrote:
E-Dot wrote:
I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...

note that's log(x + 1), not log(x)...
The series expansion for log(x+1) is:
x - x^2/2 + x^3/3 - x^4/4 ...
Handbook of Mathematical Functions, equation 4.1.24:
http://www.math.sfu.ca/~cbm/aands/page_68.htm

Mar 6 '07 #6
user923005 wrote:
Nick Keighley wrote:
>E-Dot wrote:
>>I am trying to write a program which asks the user to enter a
number in the interval [1,2], the program then gives the natural
logarithm of that number, using the series for log(x+1)...

note that's log(x + 1), not log(x)...

The series expansion for log(x+1) is:
x - x^2/2 + x^3/3 - x^4/4 ...
Handbook of Mathematical Functions, equation 4.1.24:
http://www.math.sfu.ca/~cbm/aands/page_68.htm
#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) delta *= x / ++n;
return lnx;
} /* untested, known to be slow */

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Mar 7 '07 #7
CBFalconer wrote:
>
user923005 wrote:
Nick Keighley wrote:
E-Dot wrote:

I am trying to write a program which asks the user to enter a
number in the interval [1,2], the program then gives the natural
logarithm of that number, using the series for log(x+1)...

note that's log(x + 1), not log(x)...
The series expansion for log(x+1) is:
x - x^2/2 + x^3/3 - x^4/4 ...
Handbook of Mathematical Functions, equation 4.1.24:
http://www.math.sfu.ca/~cbm/aands/page_68.htm

#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) delta *= x / ++n;
return lnx;
} /* untested, known to be slow */
Correction, above is flawed: It also sums the wrong series! as
does the following. I leave it to the student to correct the value
of delta.

#include <stdio.h>
#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) {
delta *= x / ++n;
lnxold = lnx;
}
return lnx;
} /* known to be slow */

/* ----------------- */

int main(int argc, char* *argv) {
double x;

if ((argc != 2) || (1 != sscanf(argv[1], "%lf", &x))) {
fprintf(stderr, "Usage: lnx value (>0 and <2\n");
exit(EXIT_FAILURE);
}
printf("Ln(%f) = %f\n", x, ln(x));
return 0;
}
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Mar 7 '07 #8
On Tue, 06 Mar 2007 21:40:38 -0500, CBFalconer <cb********@yahoo.com>
wrote:
>CBFalconer wrote:
>>
user923005 wrote:
Nick Keighley wrote:
E-Dot wrote:

I am trying to write a program which asks the user to enter a
number in the interval [1,2], the program then gives the natural
logarithm of that number, using the series for log(x+1)...

note that's log(x + 1), not log(x)...

The series expansion for log(x+1) is:
x - x^2/2 + x^3/3 - x^4/4 ...
Handbook of Mathematical Functions, equation 4.1.24:
http://www.math.sfu.ca/~cbm/aands/page_68.htm

#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) delta *= x / ++n;
return lnx;
} /* untested, known to be slow */

Correction, above is flawed: It also sums the wrong series! as
does the following. I leave it to the student to correct the value
of delta.

#include <stdio.h>
#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) {
delta *= x / ++n;
lnxold = lnx;
}
return lnx;
} /* known to be slow */

/* ----------------- */

int main(int argc, char* *argv) {
double x;

if ((argc != 2) || (1 != sscanf(argv[1], "%lf", &x))) {
fprintf(stderr, "Usage: lnx value (>0 and <2\n");
exit(EXIT_FAILURE);
}
printf("Ln(%f) = %f\n", x, ln(x));
return 0;
}
I don't get it.

When I run your program with an argument of 5.0, it returns
EXIT_FAILURE. But in my Windows Vista Calculator application, ln(5)
returns 1.6094379124341003746007593332262. I suspect the Windows Vista
Calculator is correct and your program is flawed, and the reason your
program is flawed has nothing to do with the value of delta--not
surprising (in my experience) for open source software.

--
jay

It's here:
http://www.microsoft.com/windows/products/windowsvista/
Mar 7 '07 #9
jaysome said:

<snip>
I don't get it.

When I run [CBFalconer's] program with an argument of 5.0, it returns
EXIT_FAILURE. But in my Windows Vista Calculator application, ln(5)
returns 1.6094379124341003746007593332262. I suspect the Windows Vista
Calculator is correct and your program is flawed,
No, the program is correct, and Windows Vista Calculator is also
correct. But they do different things.

You told the calculator to give you ln(5), and (presumably) it did
precisely that (unless you have any non-DRM-enabled equipment attached
to your machine, in which case I am given to understand that Windows
Vista may randomly corrupt your data - what fun!).

But you told the *program*, which is designed to tell you the logarithm
of a value in the interval [1,2], that the value in the interval [1,2]
that you had selected was 5. The program rightly rejected this value as
not being in the proper range for which the program was designed.

See the OP for details.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 7 '07 #10
jaysome wrote:
On Tue, 06 Mar 2007 21:40:38 -0500, CBFalconer <cb********@yahoo.com>
<snip>
Correction, above is flawed: It also sums the wrong series! as
does the following. I leave it to the student to correct the value
of delta.

#include <stdio.h>
#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) {
delta *= x / ++n;
lnxold = lnx;
}
return lnx;
} /* known to be slow */

/* ----------------- */

int main(int argc, char* *argv) {
double x;

if ((argc != 2) || (1 != sscanf(argv[1], "%lf", &x))) {
fprintf(stderr, "Usage: lnx value (>0 and <2\n");
exit(EXIT_FAILURE);
}
printf("Ln(%f) = %f\n", x, ln(x));
return 0;
}

I don't get it.

When I run your program with an argument of 5.0, it returns
EXIT_FAILURE. But in my Windows Vista Calculator application, ln(5)
returns 1.6094379124341003746007593332262. I suspect the Windows Vista
Calculator is correct and your program is flawed, and the reason your
program is flawed has nothing to do with the value of delta--not
surprising (in my experience) for open source software.
It designed only to accept values between 1.0 and 2.0.

Mar 7 '07 #11
On Wed, 07 Mar 2007 08:19:24 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:
>jaysome said:

<snip>
>I don't get it.

When I run [CBFalconer's] program with an argument of 5.0, it returns
EXIT_FAILURE. But in my Windows Vista Calculator application, ln(5)
returns 1.6094379124341003746007593332262. I suspect the Windows Vista
Calculator is correct and your program is flawed,

No, the program is correct, and Windows Vista Calculator is also
correct. But they do different things.

You told the calculator to give you ln(5), and (presumably) it did
precisely that (unless you have any non-DRM-enabled equipment attached
to your machine, in which case I am given to understand that Windows
Vista may randomly corrupt your data - what fun!).

But you told the *program*, which is designed to tell you the logarithm
of a value in the interval [1,2], that the value in the interval [1,2]
that you had selected was 5. The program rightly rejected this value as
not being in the proper range for which the program was designed.

See the OP for details.
Sorry :(
Mar 7 '07 #12
jaysome wrote:
>
On Tue, 06 Mar 2007 21:40:38 -0500, CBFalconer <cb********@yahoo.com>
wrote:
CBFalconer wrote:
>
user923005 wrote:
Nick Keighley wrote:
E-Dot wrote:

I am trying to write a program which asks the user to enter a
number in the interval [1,2], the program then gives the natural
logarithm of that number, using the series for log(x+1)...

note that's log(x + 1), not log(x)...

The series expansion for log(x+1) is:
x - x^2/2 + x^3/3 - x^4/4 ...
Handbook of Mathematical Functions, equation 4.1.24:
http://www.math.sfu.ca/~cbm/aands/page_68.htm

#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) delta *= x / ++n;
return lnx;
} /* untested, known to be slow */
Correction, above is flawed: It also sums the wrong series! as
does the following. I leave it to the student to correct the value
of delta.

#include <stdio.h>
#include <stdlib.h>

double ln(double x) {
double lnx, lnxold, delta;
int n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0)) exit(EXIT_FAILURE);
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) {
delta *= x / ++n;
lnxold = lnx;
}
return lnx;
} /* known to be slow */

/* ----------------- */

int main(int argc, char* *argv) {
double x;

if ((argc != 2) || (1 != sscanf(argv[1], "%lf", &x))) {
fprintf(stderr, "Usage: lnx value (>0 and <2\n");
exit(EXIT_FAILURE);
}
printf("Ln(%f) = %f\n", x, ln(x));
return 0;
}

I don't get it.

When I run your program with an argument of 5.0, it returns
EXIT_FAILURE. But in my Windows Vista Calculator application, ln(5)
returns 1.6094379124341003746007593332262. I suspect the Windows Vista
Calculator is correct and your program is flawed, and the reason your
program is flawed has nothing to do with the value of delta--not
surprising (in my experience) for open source software.
Of course it does. The series does not converge for that value.
If you bother to read what I wrote it is also calculating the wrong
series. The point of publishing is the method of deciding that no
further improvement is possible, bu keeping track of delta and its
relationship to the actual series sum.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Mar 7 '07 #13
E-Dot wrote:
>
I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm of
that number, using the series for log(x+1)...

Here is what I have so far and can't figure out what i'm doing wrong.
any help would be greatly appreciated, thanks guys...

#include <stdio.h>
#include <math.h>

int main() {

int i,n;
double x;
float sum, term;

printf("Enter a number in the interval [1,2]");
scanf("%d", &x);

sum = 0;
i = 0;

do {
i = i+1;
x = (double) i;
term = pow(x, i)/i;
if(i % 2 == 1)
sum = sum + term;
else
sum = sum - term;

} while(i <= n);

printf("The answer is %lf\n",sum);
/* BEGIN new.c */

#include <stdio.h>
#include <float.h>

double fs_log(double x);
double fs_sqrt(double x);

int main(void)
{
double x, e;

fputs("Enter a number in the interval [1,2]", stdout);
fflush(stdout);
if (scanf("%lf", &x) == 1) {
e = fs_log(x);
printf("The answer is %f\n", e);
} else {
puts("scanf(\"%lf\", &x) != 1");
}
return 0;
}

double fs_log(double x)
{
int n;
double a, b, c, epsilon;
static double A, B, C;
static int initialized;

if (x 0 && DBL_MAX >= x) {
if (!initialized) {
initialized = 1;
A = fs_sqrt(2);
B = A / 2;
C = fs_log(A);
}
for (n = 0; x A; x /= 2) {
++n;
}
while (B x) {
--n;
x *= 2;
}
a = (x - 1) / (x + 1);
x = C * n + a;
c = a * a;
n = 1;
epsilon = DBL_EPSILON * x;
if (0 a) {
if (epsilon 0) {
epsilon = -epsilon;
}
do {
n += 2;
a *= c;
b = a / n;
x += b;
} while (epsilon b);
} else {
if (0 epsilon) {
epsilon = -epsilon;
}
do {
n += 2;
a *= c;
b = a / n;
x += b;
} while (b epsilon);
}
x *= 2;
} else {
x = -DBL_MAX;
}
return x;
}

double fs_sqrt(double x)
{
int n;
double a, b;

if (x 0 && DBL_MAX >= x) {
for (n = 0; x 2; x /= 4) {
++n;
}
while (0.5 x) {
--n;
x *= 4;
}
a = x;
b = (1 + x) / 2;
do {
x = b;
b = (a / b + b) / 2;
} while (x b);
while (n 0) {
x *= 2;
--n;
}
while (0 n) {
x /= 2;
++n;
}
} else {
if (x != 0) {
x = DBL_MAX;
}
}
return x;
}

/* END new.c */

--
pete
Mar 11 '07 #14
pete wrote:
E-Dot wrote:
>I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm
of that number, using the series for log(x+1)...

Here is what I have so far and can't figure out what i'm doing wrong.
any help would be greatly appreciated, thanks guys...
.... snip code ...
>
/* BEGIN new.c */
.... snip code ...

A while ago I cleaned up my series accumulator, but then my ISP
glitched and cut me off from Usenet. At any rate, here is the
result. It is very slow for inputs near to 0 or 2, but not bad for
values in the range 1/sqrt(2) through sqrt(2), which is quite
enough to allow calculating any ln whatsoever. The confusion
between 80 bit and 64 bit doubles on the X86 also appears to
prolong convergence.

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* Sum ((x-1) ** N) / N for N = 1 to whatever */
double ln(double x) {
double lnx, lnxold, delta;
unsigned long n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0))
return 0.0/0.0; /* make a NAN */
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) {
delta *= -x * n / (n + 1);
if ((n 1) && !(n & 0xffffe)) /* for slow convergence */
printf("%10lu %27.19e %27.19e\n", n, delta, lnx);
lnxold = lnx;
n++;
if (!(n+1)) break; /* catch overflow */
}
return lnx;
} /* known to be slow */

/* ----------------- */

int main(int argc, char* *argv) {
double x;

if ((argc != 2) || (1 != sscanf(argv[1], "%lf", &x))) {
fprintf(stderr, "Usage: lnx value (>0 and <2\n");
exit(EXIT_FAILURE);
}
printf("Ln(%.10f) = %f\n", x, ln(x));
return 0;
}

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 12 '07 #15
CBFalconer wrote:
>
pete wrote:
E-Dot wrote:
I am trying to write a program which asks the user to enter a number
in the interval [1,2], the program then gives the natural logarithm
of that number, using the series for log(x+1)...

Here is what I have so far and can't figure out what i'm doing wrong.
any help would be greatly appreciated, thanks guys...
... snip code ...

/* BEGIN new.c */
... snip code ...

A while ago I cleaned up my series accumulator, but then my ISP
glitched and cut me off from Usenet. At any rate, here is the
result. It is very slow for inputs near to 0 or 2, but not bad for
values in the range 1/sqrt(2) through sqrt(2), which is quite
enough to allow calculating any ln whatsoever. The confusion
between 80 bit and 64 bit doubles on the X86 also appears to
prolong convergence.

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* Sum ((x-1) ** N) / N for N = 1 to whatever */
double ln(double x) {
double lnx, lnxold, delta;
unsigned long n;

if ((x <= 0) || ((x = x - 1.0) >= 1.0))
return 0.0/0.0; /* make a NAN */
lnxold = 0; delta = x; n = 1;
while ((lnx = lnxold + delta) != lnxold) {
I wonder if that condition depends upon the value of FLT_ROUNDS?
delta *= -x * n / (n + 1);
if ((n 1) && !(n & 0xffffe)) /* for slow convergence */
printf("%10lu %27.19e %27.19e\n", n, delta, lnx);
lnxold = lnx;
n++;
if (!(n+1)) break; /* catch overflow */
}
return lnx;
} /* known to be slow */

/* ----------------- */

int main(int argc, char* *argv) {
double x;

if ((argc != 2) || (1 != sscanf(argv[1], "%lf", &x))) {
fprintf(stderr, "Usage: lnx value (>0 and <2\n");
exit(EXIT_FAILURE);
}
printf("Ln(%.10f) = %f\n", x, ln(x));
return 0;
}

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com
--
pete
Mar 13 '07 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Thomas G. Marshall | last post by:
This message is sent to these newsgroups because they are no longer valid: comp.lang.java comp.lang.java.api comp.lang.java.bugs comp.lang.java.misc comp.lang.java.setup comp.lang.java.tech
6
by: What-a-Tool | last post by:
I'm going out out of my mind trying to get this to work with no luck. The error message I get is at the bottom. Can someone please tell me what I'm doing wrong here. I've tried this a million...
18
by: free2cric | last post by:
Hi, I attanded an interview on C++ Question asked were and my answers to them.. 1. In a CPP program what does memory leak occure? -- i said.. In a constructor , the pointer variables were...
5
by: Franco, Gustavo | last post by:
Hi, I have a question, and please I need a answer. How can I finalize a thread running with Application.Run (I need the message loop!!!) without call Thread.Abort?. I want to call...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
33
by: Martin Jørgensen | last post by:
Hi, In continuation of the thread I made "perhaps a stack problem? Long calculations - strange error?", I think I now got a "stable" error, meaning that the error always seem to come here now...
22
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of...
6
by: Dildo Boy | last post by:
I am trying to write a program which asks the user to enter a number in the interval , the program then gives the natural logarithm of that number, using the series for log(x+1)... Here is what...
40
by: aslamhenry | last post by:
please key in any 5 digits number : 56789 and the ouput is 5678 9 567 89 56 789 5 6789
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.