fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cout << "Enter the centimeters: ";
  7. cin >> n;
  8. double inches = n * 0.3937;
  9. cout << "\n" << n << " centimeters equals to " << inches << " inches";
  10. return 0;
  11. }
Success #stdin #stdout 0.01s 5276KB
stdin
4
stdout
Enter the centimeters: 
4 centimeters equals to 1.5748 inches