Answer to Question #269117 in Java | JSP | JSF for Bjoy

Question #269117

Create a program that will convert the input inch(es) into its equivalent centimeters. One inch is equivalent to 2.54cms. Then display the result.

1
Expert's answer
2021-11-20T06:43:36-0500


package inch;


import java.util.Scanner;




public class Inch {


    
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter inches:");
        double inc = scan.nextDouble();
        System.out.printf("The equivalent value in inches is:  %f", inc/ 2.54);
    }
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS