recursive function-CppBuzz-Forum
#include #include using namespace std; float avg(float *t,int n) {float x; if(n==1) return t[n-1] ; else{x= (t[0]+avg(t+1,n-1)); } return x/6; } int main() {int n; cout<<"enter the table size n="; cin>>n; float *t=new float[n]; for(int i=0;i >t[i];} cout<<"the average of the table's elements is:"<
Posted by citrix 2021-01-11 13:53:27
No Ans Posted
Recent Links
- Random Clustering model -CppBuzz-Forum..
- C_Size-CppBuzz-Forum..
- value =-CppBuzz-Forum..
- reverse Function in C prog-CppBuzz-Forum..
- Mingw download with no installer-CppBuzz..
- Python Online Training-CppBuzz-Forum..
- function compare_to_interval-CppBuzz-For..
- rectangle.c -CppBuzz-Forum..
- Converting for loop to while loop-CppBuz..
- How to remove the (*) as we reach the en..
- more..