Questions de codage Tech Mahindra
#include<iostream>
using namespace std;
int calculateTotalInterest(int n, int arr[])
{
int tax=0;
for(int i=0;i<n;i++)
{
tax=tax+(int)((arr[i]-1000)*0.2);
}
return tax;
}
int main()
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)cin>>arr[i];
cout<<calculateTotalInterest(n,arr);
return 0;
}
Siddhant