158k views
3 votes
Convert inches to centimeters in html and javascript.​

User PJ Eby
by
8.5k points

1 Answer

3 votes

Answer:

Here is some simple code written in javascript that should do the job

Step-by-step explanation:

var input = readInt("Enter the number of Inches")

//Gets the number of inches

var result = input * 2.54

// One inch is equal to 2.54 centimeters

print(result+ " Centimeters")

//Returns the resulting number of centimeters

User ThisIsNoZaku
by
8.0k points