Question: The following program has several syntax errors as well as style inconsistencies. Correct the syntax errors and identify the style violations. namespace Chapter2 { class
The following program has several syntax errors as well as style inconsistencies.
Correct the syntax errors and identify the style violations.
namespace Chapter2
{
class converter
{
static void main(
{
CONST int inches = 12;
int x = 100; y = 10;
float z = 22.45;
double ans;
ans=inches+z*x%y;
System.write("The result is {f2:0} " + "ans");
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
