int calculateBounceCnt(){
float height = 0.0;
int bounces = 0;
printf("Enter the initial height: ");
scanf("%f", &height);
while (height >= 0.4){
height *= 0.9;
bounces++;
}
printf("The number of bounces is: %d\n", bounces);
return bounces;
}
Comments
Leave a comment