**New course!**Every coder should learn

**Generative AI!**

+ 1

# Arrays

I need to make 3 functions: one to fill in an array another one is to print that array and the last one is to indicate how many values of that array are bigger than 32. Anyone able to help?

2 Answers

+ 1

~ swim ~ here's the code I thought of without functions.
#include<iostream>
using namespace std;
int main()
{
int n,cont=0;
cout<<"How big is the array? "<<endl;
cin>>n;
cout<<"Insert the values of the array: "<<endl;
int v[n];
for(int i;i<n;i++)
{
cin>>v[i];
if(v[i]>32)
{
cont++;
}
}
for(int i;i<n;i++)
{
cout<<v[i];
}
cout<<"There are "<<cont<<" values that are bigger than 32"<<endl;
return 0;
}

0

I have and spent 3 hours trying to figure this apparently simple problem but I just can't find the solution. My idea was to make a function to fill the array, return the array then make another function to get that array and output it then make another function that gets it and checks if every value of the array is greater than 32