Computer Science, asked by helldevil0007, 11 months ago

write a program to calculate sum and average of three integer values through function​

Answers

Answered by advancedcattechnical
2

Answer:

#include<stdio.h>

#include<math.h>

main()

{

int a,b,c,sum;

float avg;

printf("Enter the three integers: ");

scanf("%d%d%d",&a,&b,&c);

sum=a+b+c;

avg=sum/3;

printf("The required sum and average are %d and %f respectively",sum,avg);

}

Explanation:

Answered by harshsen120
0

Answer:

Explanation:include<stdio.h>

int avg(int,int,int);

int main()

{ int a,b,c;

printf("enter the three value ");

scanf("%d%d%d",&a,&b,&c);

avg(a,b,c);

return 0;

}

int avg(int a, int b, int c)

{ float average;

average=(a+b+c)/3.0;

printf("average=%f",average);

return average;

}

Similar questions