asked 24.7k views
5 votes
When the declaration/// int y = 5; /// is followed by the

assignment /// y += 3.7; /// the value of y is _______.

1 Answer

2 votes

Answer:

y = 8.7

Explanation:

Assuming we can use decimal places, y is equal to 8.7.

In programming, += is often used as a substitute for y = y + x (example)

Therefore, y = y + 3.7, and since y = 5, y = 5 + 3.7, y = 8.7

answered
User WP Learner
by
7.9k points

No related questions found

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.