The diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,
find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole
number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.
#include<iostream>
using namespace std;
int main()
{
int D,Speed;
cout<<"Enter the Diameter in cm: ";
cin>>D;
double c=3.142*D/100;
cout<<"Enter the speed in Km/h: ";
cin>>Speed;
double x=Speed*5/18;
double distance=x*1*60;
int answer=distance/c;
cout<<"Revolutions per minute is: "<<answer;
}
Comments
Leave a comment