Function media

Run Settings
LanguageC
Language Version
Run Command
//funzioni #include <stdio.h> #include <stdlib.h> int somma(int a,int b) { int c; c=a+b; return c; } int sottrazione(int a,int b) { int c; c=a-b; return c; } float media(int a, int b){ float c; c=(float)(a+b)/2.0; return c; } int main() { float rismedia; int x,y; printf("Inserisci x e y: \n"); scanf("%d %d",&x,&y); int sum,sotr; sum=somma(x,y); sotr=sottrazione(x,y); rismedia=media(x,y), printf("sum:%d\n",sum); printf("Sotr:%d\n",sotr); printf("Media:%.2f\n",rismedia); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines