Using C programming 6 The mass of a single molecule of water

Using C programming

6. The mass of a single molecule of water is about 3.0x10-23 grams. A quart of water is about 950 grams. Write a program that requests an amount of water, in quarts, and displays the number of water molecules in that amount.

Solution


Program:

#include <stdio.h>

int main( int argc, char ** argv )

{

int num_grams_in_quart = 950;
float molecule_mass = 3.0e-23;
int quarts;

printf(\" enter a water amount in quarts: \");

scanf(\"%d\", &quarts);

float num_molecules = ((quarts * num_grams_in_quart) / molecule_mass);

printf(\"The no. of water molecules is %f or %e.\ \", num_molecules, num_molecules);

return 0;

}

Using C programming 6. The mass of a single molecule of water is about 3.0x10-23 grams. A quart of water is about 950 grams. Write a program that requests an am

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site