#include <iostream.h> // allows program to output data to the screen
// function main begins program execution
int BatsmanAvg(int TotalRuns, int TotalMatches) ;
main()
{
int stopit;
int TotalRuns, TotalMatchesPlayed =0;
cout << "Please Entere the total Runs made : " ;
cin>> TotalRuns ;
cout << "Please Entere the total match played : " ;
cin>> TotalMatchesPlayed ;
cout << "\n Avg Runs = " << BatsmanAvg(TotalRuns,TotalMatchesPlayed);
cin>> stopit; //pause screen to show output
}
int BatsmanAvg(int TotalRuns, int TotalMatches)
{
return TotalRuns/TotalMatches;
}
Nice work,thanx
ReplyDelete