C语言基础:简单的数学运算的代码


如下资料是关于C语言基础:简单的数学运算的内容。
#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编译运行输出结果



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





 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM