Assume that the following code segment is correct except for
Assume that the following code segment is correct, except for some missing punctuation marks such as parentheses, semicolons, and brackets. Add the necessary punctuation to correct the code in such a way that the indentation does not need to be changed for readability. if a > b x = x + 10 printf(\"%lf\ \", x) else printf(\"%If\ \", y) printf(\"%If\ \", z)
Solution
This is code after eleimianting syntax errors
//we have to place the condition inside the brackets
if(a>b)
{
x=x+10; //Every statement in java should ends with semi colon
printf(\"%lf\ \",x); //Every statement in java should ends with semi colon
}
else
printf(\"%lf\ \",y); //Every statement in java should ends with semi colon
printf(\"%lf\ \",z); //Every statement in java should ends with semi colon
___________________________
