13.8k views
3 votes
"There are 1.6093 kilometers in a mile. Create a variable to store a number of miles. Convert this to kilometers, and store in another variable."

1 Answer

7 votes

MATLAB CODE:

%%%%

clc

dist_mile=input('enter the distance in miles') %%%dist_mile stores given distance in miles

dist_km=dist_mile*1.6093 %%coversion of dist_mile into km and storing in dist_km

%%%%

OOUTPUT:

enter the distance in miles

2

dist_km

3.2186

User Leandro Ariel
by
4.2k points