How to find speed per hour in c++

How to find speed per hour in c++


Enter the distance traveled in miles=34

Enter the speed of vehicle (mph)=56

Time required to reach destination=0.60 hours


#include<iostream>

#include<conio.h>

using namespace std;

int main()

{

 double distance, time, speed;

 cout<<"Enter the distance traveled in miles:";

 cin>>distance;

 cout<<"Enter the speed of vehicle (mph):";

 cin>>speed;

 time=distance/speed;

 cout<<"Time required to reach destination:"<<time<<" hours"<<endl;

 return(0);

}

Comments

Popular posts from this blog

Use tab to auto complete commands in the command line

Typing Tricks