Given two integers A and B representing the run scored and ball faced by a batsman in a Cricket match. The task is to calculate the Strike rate of the batsman.
Batting strike rate is a measure of how quickly a batsman achieves the primary goal of batting. It is mathematically equal to:
Strike Rate = (Runs Scored / Balls faced) * 100
Examples:
Input: A = 264, B = 173
Output: 152.601
Explanation:
Srike rate of batsman is equal to (264 / 173) * 100 = 162.601Input: A = 0, B = 10
Output: 0.00
Approach:

Use the formula for the strike rate to calculate the strike rate.
Strike Rate = (Runs Scored / Balls faced) * 100  Return the strike rate in float data type format.
Here is the implementation of the above approach:
C++
// C++ program to calculate strike // rate of a batsman #include <bits/stdc++.h> using namespace std; // function to calculate strike // rate of a batsman float strikerate( int bowls, int runs) { float z; z = ( float (runs) / bowls) * 100; return z; } // Driver Code int main() { int A, B; A = 264; B = 173; cout << strikerate(B, A) << endl; return 0; } 
Java
// Java program to calculate strike // rate of a batsman class GFG{ // function to calculate strike // rate of a batsman static float strikerate( float bowls, float runs) { float z; z = (runs / bowls) * 100 ; return z; } // Driver Code public static void main(String[] args) { int A, B; A = 264 ; B = 173 ; System.out.println(strikerate(B, A)); } } // This code is contributed by rock_cool 
Python3
# Python3 program to calculate strike # rate of a batsman # function to calculate strike # rate of a batsman def strikerate(bowls, runs): z = ( float (runs) / bowls) * 100 ; return z; # Driver Code A = 264 ; B = 173 ; print (strikerate(B, A)); # This code is contributed by Code_Mech 
C#
// C# program to calculate strike // rate of a batsman using System; class GFG{ // function to calculate strike // rate of a batsman static float strikerate( float bowls, float runs) { float z; z = (runs / bowls) * 100; return z; } // Driver Code public static void Main() { int A, B; A = 264; B = 173; Console.Write(strikerate(B, A)); } } // This code is contributed by Code_Mech 
152.601
Time Complexity: O (1)
Auxiliary Space: O (1)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a studentfriendly price and become industry ready.
Recommended Posts:
 Find the Batting Average of a batsman
 Count of a, b & c after n seconds for given reproduction rate
 Program to find the rate percentage from compound interest of consecutive years
 Find if the glass will be empty or not when the rate of drinking is given
 Efficient program to calculate e^x
 Calculate the angle between hour hand and minute hand
 C program to calculate the value of nPr
 Fast method to calculate inverse square root of a floating point number in IEEE 754 format
 Program to calculate the value of sin(x) and cos(x) using Expansion
 Program to calculate the number of odd days in given number of years
 Calculate the Discriminant Value
 Program to Calculate Body Mass Index (BMI)
 Calculate Volume, Curved Surface Area and Total Surface Area Of Cylinder
 Calculate Volume and Surface area Of Sphere
 Program to calculate distance between two points
 Calculate volume and surface area of a cone
 Program to calculate volume of Ellipsoid
 Program to calculate age
 Program to calculate area and perimeter of Trapezium
 Program to calculate area and volume of a Tetrahedron
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.