//Write a c++ program that will input double numbers for the user in a loop
// until the average of the numbers is less than 10. When the loop ends
// display the sum and the average of the numbers.
i tried but failed miserably to solve this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include<iostream>
usingnamespace std;
int main()
{
int n, avg=10, sum=0, i;
while (i <=avg)
{
cout<<"Enter a number";
cin>>n;
sum = sum+n;
avg= sum/i;
i++;
}
cout<<"sum ="<<sum<<endl;
cout<<"avg = "<<avg;
return 0;
}