Answer to Question #177969 in C for Mantripragada Venkata Vishnu Sai

Question #177969

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


1
Expert's answer
2021-04-03T10:38:04-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS