Computer Science, asked by oindrayee41, 1 year ago

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 charlie1505
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 kandarilaxmi38
0

Answer:

int. a =45.1 correct the given snippet

Similar questions