Q:

Write a program in C++ that converts kilometers per hour to miles per hour

0

Write a program in C++ that converts kilometers per hour to miles per hour

Sample Output:

 Convert kilometers per hour to miles per hour :                       
----------------------------------------------------                   
 Input the distance in kilometer : 25                                  
 The 25 Km./hr. means 15.5343 Miles/hr. 

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
using namespace std;

int main()
{
    float kmph, miph;
	cout << "\n\n Convert kilometers per hour to miles per hour :\n";
	cout << "----------------------------------------------------\n";	
    cout << " Input the distance in kilometer : ";
    cin >> kmph;
	miph = (kmph * 0.6213712); 
    cout << " The "<< kmph <<" Km./hr. means "<< miph << " Miles/hr." << endl;
	cout << endl;
    return 0;
}	

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now