#include<iostream>
using namespace std;
void anik(int ar[], int size)
{
int s = 0, i;
for(i=0;i<size;i++)
{
cout << ar[i] << " ";
s = s + ar[i];
}
cout << endl;
cout << "Sum :: " << s << endl;
}
int main()
{
int arr[5], i;
cout << "Enter Five Number : ";
for(i=0;i<5;i++)
{
cin >> arr[i];
}
cout << endl;
anik(arr, 5);
return 0;
}
using namespace std;
void anik(int ar[], int size)
{
int s = 0, i;
for(i=0;i<size;i++)
{
cout << ar[i] << " ";
s = s + ar[i];
}
cout << endl;
cout << "Sum :: " << s << endl;
}
int main()
{
int arr[5], i;
cout << "Enter Five Number : ";
for(i=0;i<5;i++)
{
cin >> arr[i];
}
cout << endl;
anik(arr, 5);
return 0;
}
Comments
Post a Comment