#include <iostream>
#include <cmath>
using namespace std;
struct car
{
int traveled_distance;
float time;
};
int main()
{
car arr[10];
int i;
for(i = 0; i < 10; i++)
{
cout << "Enter traveled distance of car " << i+1 << " : ";
cin >> arr[i].traveled_distance;
cout << "Enter time of car " << i+1 << " : ";
cin >> arr[i].time;
}
for(i = 0; i < 10; i++)
{
cout << 2*arr[i].traveled_distance/(pow(arr[i].time, 2)) << endl;
}
return 0;
}
Comments
Leave a comment