#include
using namespace std;
int main ()
{
int age[5];
int *p;
int sum=0;
p=age;
for(int i=0;i<5;i++)
{
cout << "Enter the age of a student" << endl;
cin >> *p;
sum=sum+*p;
p++;
}
p=age;
cout << "The sum of the ages is : " << sum << endl;
cout << "The age of the last student is : " << *(p + 4) << 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