Write A Program To Read Four Floating Point Numbers And Find Their Sum And Average?

1

1 Answers

Wade Arnold Profile
Wade Arnold answered
#include<iostream.h>
#include<conio.h>
main()
{
float a[4],sum=0,avg=0;
int I;
cout<<"Enter the four numbers to find their sum and average;
for(I=0;I<=3;I++)
{
cin>>a[I];
}
for(I=0;I<=3;I++)
{
sum=sum+a[I];
}
cout<<"The Sum of numbers is:"<<sum;
avg=sum/4;
cout<<"the average of numbers is"<<avg;
}

Answer Question

Anonymous