Velocity Reviews > C++ > What value

# What value

Jimbo1873
Guest
Posts: n/a

 08-18-2006
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;

Thomas J. Gritzan
Guest
Posts: n/a

 08-18-2006
Jimbo1873 schrieb:
> Hi can someone help me with these problems.

http://www.parashift.com/c++-faq-lit...t.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

Rolf Magnus
Guest
Posts: n/a

 08-18-2006
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.

red floyd
Guest
Posts: n/a

 08-18-2006
Jimbo1873 wrote:
> [blatant "do my homework" redacted]

directly to him, and save you the trouble.

Guest
Posts: n/a

 08-18-2006

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.