Question #177969

Finding the total measurements in fleet from a list of 5 numbers


Expert's answer

#include<iostream>
using namespace std;
int findTotalFeet(int n, int arr[])
{
    int feet=0;
    for(int i=0;i<n;i++)
    {
        feet+=arr[i]/12;
    }
    return feet;
}
int main()
{
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)cin>>arr[i];
    cout<<findTotalFeet(n,arr);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS