C++ do While loop? I am writing a do while loop program in which the user inputs
ID: 3654519 • Letter: C
Question
C++ do While loop?
I am writing a do while loop program in which the user inputs data. The user tells the program how many values are to be entered in the program. After which the user inputs the data. A function is then used to calculate the average of the odd and even numbers. The maximum and the minimum number.
#include <iostream>
Using namespace std;
Void myAveFuctioin(){
//function to calculate average of even and odd numbers. The maximum and minimum number.
}
int main(){
do{
cout<<" how many numbers do you want to enter: ";
cin>>entries;
cout<<"Please enter number "<<counter++<<": ";
cin>>number;
}while(counter<=entries)
}
How do I call the AveFunction into the main()? Considering I am using a do while loop. I am also doing this without using arrays or the <cmath> library ?
Explanation / Answer
#include Using namespace std; Void myAveFuctioin(float *avg,int *max ,int *min,int entries,int no){ //function to calculate average of even and odd numbers. The maximum and minimum number. if(no>*max) *max=no; if(noRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.