Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

which of the following is a correct assignment statement? int b = -7; i…

Question

which of the following is a correct assignment statement? int b = -7; int 4 = c; int a = 2.4;

Explanation:

Brief Explanations

An integer assignment statement requires a valid variable name on the left and an integer value on the right. The first option uses a valid variable b and assigns an integer -7. The second option has an invalid variable name 4 (starts with a number). The third option assigns a non-integer 2.4 to an integer variable.

Answer:

int b = -7;