# C++ Program Calculate the Sum, Average and standard Deviation of these Numbers. ## Code:

#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
void main()
{
int num,i,sum=0,avg,stdvi,var=0;
int *p;
cout<<“Enter 5 Numbbers:\n”;
for(i=0;i<5;i++)
{
cin>>num[i];
p[i]=&num[i];
sum+=*p[i];
}
avg=sum/5;
for(i=0;i<5;i++)
{
var+=pow(num[i]-avg,2);
var=var/5;
stdvi=sqrt(var);
}
cout<<“Sum of 5 Numbers is: “<<sum;
cout<<“\nAverage of 5 Numbers is: “<<avg;
cout<<“\nStandard deviation of these Numbers is: “<<stdvi;

getch();
}

```#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
void main()
{
int num,i,sum=0,avg,stdvi,var=0;
int *p;
cout<<"Enter 5 Numbbers:\n";
for(i=0;i<5;i++)
{
cin>>num[i];
p[i]=&num[i];
sum+=*p[i];
}
avg=sum/5;
for(i=0;i<5;i++)
{
var+=pow(num[i]-avg,2);
var=var/5;
stdvi=sqrt(var);
}
cout<<"Sum of 5 Numbers is: "<<sum;
cout<<"\nAverage of 5 Numbers is: "<<avg;
cout<<"\nStandard deviation of these Numbers is: "<<stdvi;

getch();
}```

## Output: ### 2 thoughts on “C++ Program by using pointer that receives array of 5 integers numbers and calculate the sum, average and standard deviation of these numbers.”

1. Valuable information

Valuable information. Lucky me I found your website by accident, and I’m shocked why this accident didn’t happened earlier! I bookmarked it.