Find time, distance and speed in C++(C Plus Plus)
In this latest tutorial, we will cover the program to find the time, distance and speed in C++(C Plus Plus)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Find time=distance/speed #include <iostream> using namespace std; int main() { int dis,sp; float t; cout<<"Enter the distance: "; cin>>dis
; cout<<"Enter the speed: "; cin>>sp; t=dis/sp; cout<<"The time required is: "<<t<<endl; } |