#include
#include
template
T
sum(T *a,int n)
{
T s=0;
for(int i=0;i
{
s=s+a[i];
}
return s;
}
void
main()
{
clrscr();
int n;
double a[20];
cout<<"Enter no. of
elements:";
cin>>n;
cout<<"\nEnter the
elements:";
for(int i=0;i
{
cin>>a[i];
}
cout<<"\nSum:
"<
getch();
}
No comments:
Post a Comment