Computer Science, asked by EthicalElite, 7 months ago

Please answer it by C++ method...


Otherwise name a brainly teacher good in Computer...​

Attachments:

Answers

Answered by Anonymous
3

C++ Program to calculate distance :

// C++ Program to calculate distance

#include<iostream>

using namespace std;

// Function to calculate distance traveled

double cal_dis(double speed, double time)

{

cout << "\n Time(hr) : " << time ;

cout << "\n Speed(km / hr) : " << speed ;

return speed * time;

}

// Driver function

int main()

{

// Calling function cal_dis()

cout << "\n The calculated Distance(km) : "

<< cal_dis(70.0,5.0) << endl ;

return 0;

}

Output :

Time(hr) : 5

Speed(km / hr) : 70

The calculated Distance(km) : 350

Answered by Anonymous
0

Explanation:

I hope it may help to you..

Attachments:
Similar questions