Answer to Question #259895 in C for fas

Question #259895

In a box of total area 10000cm3, Mr. Varun has to pack the balls of given radius “r” and all the balls have the same volume, Help Mr. Varun to find the total number of balls that he can pack in the given box.

Requirements

Capture the radius of the ball “r”

Compute the volume (Hint: Volume=4/3πr3)

Calculate how many number of balls can be placed in the box of 10000cm3 box

Display the number of balls packed by Mr. Varun


1
Expert's answer
2021-11-04T16:28:31-0400
#include <stdio.h>


int main()
{
    float r;
    printf("\nEnter radius of the ball: ");
    scanf("%f",&r);
    float pi=3.142;
    float volume=(4/(3*pi*r*r*r));
    float n=10000.0/volume;
    printf("\nNumber of balls packed: %f",n);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS