If I write double a b 100 will the value 100 be assigned to

If I write \"double a, b = 10.0\" will the value 10.0 be assigned to both a and b or just b?

Solution

double a,b=10.0;

Here we are declaring the variables \'a\',\'b\' as doubles.

But we are initializing the variable \'b\' with the value 10.0.

But we are not initializing the variable \'a\' here.

10.0 is assigned only to the variable \'b\'.

_________________________________

If I write \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site