write a program in C ++ to input the distance in metre and convert it into centimetre
Answers
Answered by
1
Program:
#include <iostream>
using namespace std;
int main(){
int meter,cm;
cout<<"Enter distance in meters : ";
cin>>meter;
cout<<"Distance in cm is : "<<(meter*100)<<"cm";
return 0;
}
Output:
Enter distance in meters : 10
Distance in cm is : 1000 cm
Explanation:
- first i initialized meter,cm as int
- then i took input meter number
- the i printed number after multiplying it will 100
- because 1m = 100cm
----Hope this will help you ( mark my answer as brainliest if you like the way i answered :) )
rakeshchennupati143:
if you like my answer, mark it as brainliest tnq!
Similar questions