How to find the sum and average of three numbers in a c program?
Solution
#include<stdio.h>
void main()
{
system("clear");
float a,b,c,ave,sum;
printf("enter the 3 numbers");
scanf("%f%f%f",&a,&b,&c);
sum=a+b+c;
ave=(a+b+c)/3;
printf("the sum is %f",sum);
printf("\nthe average is %f",ave);
}
Thanks & Regards,
Anju Soosan George
Assistant Professor
No comments:
Post a Comment