Write a program to declare two integer and one float variables then initialize them to 10, 15, and 12.6. Also print the variable values in thescreen.
Answers
Answer:
public class main
{
public static void main()
{
int a = 10 ;
int b = 15 ;
float c = 12.6f ;
System.out.println(a) ;
System.out.println(b) ;
System.out.println(c) ;
}
}
Explanation:
easy
Answer: A variable is a named storage location in a computer's memory that can hold a value of a specific data type, such as an integer, float, string, or boolean.
Explanation:
Here is an example of a program that declares two integer variables, a and b, and one float variable, c, and initializes them to 10, 15, and 12.6, respectively. The program then prints the values of the variables to the screen:
a = 10
b = 15
c = 12.6
print("a: ", a)
print("b: ", b)
print("c: ", c)
This program uses the assignment operator = to initialize the variables a, b, and c to the specified values. The print() function is then used to display the values of the variables to the screen.
To know about variables, click on the link below:
https://brainly.in/question/9067360
To know about float, click on the link below:
https://brainly.in/question/5063952
#SPJ2