73.7k views
2 votes
Write a statement that declares and creates t.

a) int t = 0;
b) float t = 0.0;
c) double t = 0.0;
d) char t = ' ';

User Don Omondi
by
7.8k points

1 Answer

5 votes

Final answer:

The correct statement to declare and create variable t is 'int t = 0;'.

Step-by-step explanation:

The correct statement that declares and creates variable t depends on the data type needed. From the given options, the correct statement is a) int t = 0;

The statement a) int t = 0; declares and creates an integer variable named t and initializes it with the value 0.

It is important to choose the appropriate data type when declaring a variable based on the intended use and the value it will hold.

User Tore Aurstad
by
7.8k points