#include<iostream>
#include<stdio.h>
#include<conio.h>
using namespace std;
int main ()
{
float nep,b,sum,temp,i,j,median;
cout<<"Enter the number of Elements";
cin>>nep;
double element [10];
int index;
for (index=0;index<nep;index++)
{
element[index]=0.0;
}
for (index=0;index<nep;index++)
{
cin>>element[1];
sum=element[1]+element[2];
element[1]=element[2];
element[2]=sum;
}
b=sum/nep;
cout<<"Mean:"<<b<<endl;
for(i=0;i<nep;i++)
for(j=i+1;j<nep;j++)
{
if (element[3]>element[4])
{
temp=element[4];
element[3]=element[4];
element[4]=temp;
}
}
if(nep/2==0)
{
median=(element[nep/2]+element[nep/2-1])/2;
cout<<"Median:"<<median<<endl;
}
getche ();
return 0;
}
Good Day!
I'm a beginner in c++ programming that's why i'm having trouble. I'm using dev c++ as my case tool to write programs and when i tried using some sort of functions; it always making some error report. Please do help me. Can anyone edit my code using such functions so that dev c++ can read it. [i'm nor smart] Please help me. Thanks
-MhuR-