Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

which of the following is a correct assignment statement? double b = -4…

Question

which of the following is a correct assignment statement?
double b = -42c;
double d = -12.03;
double a = 3.28

Explanation:

Brief Explanations

In programming (relevant to Computer Science), a correct double variable assignment requires a valid double value on the right and a semicolon at the end. The first option uses an undefined variable c, the third lacks a semicolon. The second option assigns a valid double literal -12.03 to d with a semicolon.

Answer:

double d = -12.03;