51.8k views
5 votes
Which statement stores an integer value in a variable?

a) count = 5;
b) count = 5.0;
c) count == 5;
d) count != 5;

User Halcyon
by
7.8k points

1 Answer

5 votes

Final answer:

The correct statement to store an integer value in a variable is 'count = 5;', as it assigns the integer value 5 to the variable count.

Step-by-step explanation:

The statement that stores an integer value in a variable is a) count = 5;

Option b) count = 5.0; indicates a floating-point assignment, not an integer. Option c) count == 5; is a comparison, not an assignment. Option d) count != 5; is a 'not equal' comparison. Thus, the correct answer is option a), which assigns the integer value 5 to the variable count.

User Dumbass
by
8.5k points