5. Correct the given snippet:
int a = 45.1;
float b = 15.05;
double c = 92;
sum = 0;
sum = (a+b)*c/2;
System.out.println(“The answer =" +ans)
Answers
Answered by
9
Answer:
int a-45;..... int doesn't accept 45.1
flaot b-15.05;
int c-92; ... no need to take double
float sum-(a+b) *c/2;
sop(ans);
Answered by
0
Answer:
int. a =45.1 correct the given snippet
Similar questions