#include
using namespace std;
int arrayInputSum(int *pa, int size)
{
int *pp = pa;
int sum = 0;
for(int i=0;i
{
cout << "Enter the age of a student" << endl;
cin >> *pp;
sum=sum+*pp;
pp++;
}
return sum;
}
int main ()
{
int age[5];
int sum = arrayInputSum(age,5);
cout << "The sum of the ages is : " << sum << endl;
return 0;
}
Edu-Tester is Powered by Blogger and Wearing Capung Template ; an XML Blogger Template Designed By Gre | Template-Godown
0 comments:
Post a Comment