what will be the date type of the expression (a<50)?var 1:var 2;
provide a=int,var1 =double,var2= float
Answers
expression (a < 50)? var1 : var2;
a) int
b) float
c) double
d) Cannot be determined
View Answer
Answer:
a: int
var1: double
var2: float
Question : what will be the date type of the expression (a<50)?var 1:var 2; provide a=int,var1 =double,var2= float.
Step-by-step explanation:
From the above question,
They have given :
The expression (a<50) compares the value of a to 50, so the data type of a must be an integer. Var1 and var2 are variables, so their data types will depend on how they are defined elsewhere in the code, but in this context they can be assumed to be double and float respectively.
a: int
var1: double
var2: float
a = int, var1 = double, var2 = float
code:
int a;
double var1;
float var2;
if (a<50) {
var1 = a*2;
var2 = a/2;
}
else {
var1 = a*3;
var2 = a/3;
}
provide a=int,
var1 =double,
var2= float
double var1;
float var2;
For more such related questions : https://brainly.in/question/34304192
#SPJ1