Computer Science, asked by shashwasingh, 11 months ago

write a program in C ++ to input the distance in metre and convert it into centimetre​

Answers

Answered by rakeshchennupati143
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!
shashwasingh: but this answer is wrong
shashwasingh: don't mind
rakeshchennupati143: i will answer this question with another account? then can you give this account's answer a brainliest?
rakeshchennupati143: i'm sorry i can edit wait
rakeshchennupati143: there you go i edited the answer
rakeshchennupati143: check the answer it is in c++ with cin's and cout's
Similar questions