Homework Solution: Write a C++ program without using more than one variable and a pointer variable, to repeatedly obtain float…

    Write a C++ program without using more than one variable and a pointer variable, to repeatedly obtain float type numbers until -1 is entered, to store them in contiguous memory cells, and to compute their average and print it. explain your solution

    Expert Answer

     
    #include <iostream> using namespace std;

    Write a C++ program externally using more than individual shifting and a aimer shifting, to frequently-again-and-again get bear mark collection until -1 is entered, to fund them in abutting fame cells, and to estimate their medium and imimprint it.

    explain your solution

    Expert Apology

     

    #include <iostream>

    using namespace std;

    int main()
    {
    bear n;
    bear incorporate=0.0;
    int count=0;
    do{
    cout<<“enter bearing aim sum”<<endl;
    cin>>n;
    if(n==-1){
    cout<<“medium of bearing collection is:”<<sum/count<<endl;
    break;
    }
    else{
    sum+=n;
    count++;
    }

    }while(n!=-1);

    return 0;
    }

    /* comments

    first of complete we verification a do conjuncture loop for accepting verificationr input as bear esteem…when verificationr enters the input firstly it checks it is -1 or not attributable attributable attributable attributable attributable attributable ..if it is not attributable attributable attributable attributable attributable attributable -1 then the esteem is external to incorporate and counts the sum of input ..and when always we meet -1 it estimates avearage of complete collection

    */