Write a program in java to accept the centimeter and display the result after converting it into number of kilometer, meter and the remaining centimeter, with proper message.
Answers
Answered by
0
Answer:
include <bits/stdc++.h>
using namespace std;
int main()
{
float cm, meter, kilometer;
cm = 1000;
// Converting centimeter into meter
// and kilometer
meter = cm / 100.0;
kilometer = cm / 100000.0;
cout << "Length in meter = " << meter << "m"
<< "\n";
cout << "Length in Kilometer = " << kilometer << "km"
<< "\n";
return 0;
}
Similar questions