# What value

Discussion in 'C++' started by Jimbo1873, Aug 18, 2006.

1. ### Jimbo1873Guest

Hi can someone help me with these problems.
1. what value is assigned to the type 'double' variable 'x' by the
statement
x = 25.0 * / 2.5;

2. what value is assigned to 'x' by the following statement, assuming
'x' is 10.0?
x = x - 20.0;

Jimbo1873, Aug 18, 2006

2. ### Thomas J. GritzanGuest

Jimbo1873 schrieb:
> Hi can someone help me with these problems.

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2

> 1. what value is assigned to the type 'double' variable 'x' by the
> statement
> x = 25.0 * / 2.5;

Why don't you try it yourself?

> 2. what value is assigned to 'x' by the following statement, assuming
> 'x' is 10.0?
> x = x - 20.0;

--
Thomas

Thomas J. Gritzan, Aug 18, 2006

3. ### Rolf MagnusGuest

Jimbo1873 wrote:

> Hi can someone help me with these problems.
> 1. what value is assigned to the type 'double' variable 'x' by the
> statement
> x = 25.0 * / 2.5;

None.

> 2. what value is assigned to 'x' by the following statement, assuming
> 'x' is 10.0?
> x = x - 20.0;

Isn't that obvious?

Btw: please always post minimal, but complete programs, not just single
lines of code without context.

Rolf Magnus, Aug 18, 2006
4. ### red floydGuest

Jimbo1873 wrote:
> [blatant "do my homework" redacted]

If you give me your instructor's email address, I'll send the answers
directly to him, and save you the trouble.

red floyd, Aug 18, 2006
5. ### Guest

Jimbo1873 wrote:
> Hi can someone help me with these problems.

<Snipped>
> 2. what value is assigned to 'x' by the following statement, assuming
> 'x' is 10.0?
> x = x - 20.0;

Ummm, if you can't figure this out, the best advice I can give you is
to switch to a degree program in fine arts or humanities.

, Aug 18, 2006