Write declaration statements to declare and initialize two variables: one is an integer variable named age, initialized to 18, and the other variable, named weight, is initialized to 114.5.

Respuesta :

Answer:

int age;

age=18;

float weight;

weight=114.5F;

Step-by-step explanation:

int age; \\ it is declared as integer because 18 is an integer value

age=18; \\ initialized as 18 is stored in the variable 'age'

float weight; \\ weight is declared as float because it's value is floating or decimal value which cannot be declared as integer value

weight=114.5F; \\ F shows that it's single floating type value of 32 bits, if F is not written then it means it double floating type value which is 64 bits long

Q&A Education