שפת C/פעולות חשבוניות/תרגילים: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
Atavory (שיחה | תרומות)
אין תקציר עריכה
שורה 134:
 
{{מוסתר|ta2 = left|פתרון|2=
<source lang="c">
#include <stdio.h>
 
int main()
{
int sum=78+84+45+97+64, amount=5; //sum is the sum of the grades, and amount is the amount of grades
float average=(float) sum/amount;
printf("%f\n", average);
return 0;
}
</source>
}}