C programming language: Simple math code

The following information about the C programming language: the contents of simple mathematical operations.
#include <stdio.h>

int main ()
{
int seconds_in_an_hour;

float average;


average = (5 + 10 + 15 + 20) / 4;

printf("The number of seconds in an hour %dn",
seconds_in_an_hour);

printf("The average of 5, 10, 15, and 20 is %fn",
average);

printf("The number of seconds in 48 minutes is %dn",

return 1;
}

 




gcc compiler run output



The number of seconds in an hour 3600
The average of 5, 10, 15, and 20 is 12.000000
The number of seconds in 48 minutes is 2880





 

Guess you like

Origin www.cnblogs.com/magnolia62/p/11456990.html