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