C++ program to convert millimeters into centimeters

Views: 193   

Following program shows you how to convert millimeters into centimeters.
In this program we get millimeters from user, once we get those we need to divide with 10 so that we get in centimeters

#include <iostream>
#include <math.h>

int main() {
    float millimeters;
    std::cout << "Please enter millimeters:";
    std::cin >> millimeters;
    float centimeters = millimeters / 10;
    std::cout << centimeters << " Centimeters";


Please enter millimeters: 200
20 Centimeters
On By