Hi.i program a software to get scores from admin and sort them ascending then show the middle score(if admin enter middle).but when i compile it nothing happen.what should i do?here's code ,i use dev compiler
Code:
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
int counter,j,count,counter2,m;
char function[80];
float scores,varyans,middle,ave,sum=0,i;
float student [100];
cout<<"enter scores\n";
cout<<"for end enter-1\n";
for(counter=0;counter<100;counter++)
{
cin>>student[counter];
if(student[counter]==-1)
break;
}
count=counter;
cout<<"what to do\n";
cin>>function;
if(strcmp(function,"middle")==0)
{
for( ;counter>=0;count--)
for(j=0;j<=count;j++)
if(student[j]>student[j+1])
{
i=student[j];
student[j]=student[j+1];
student[j+1]=i;
}
for(;count>0;count--)
cout<<student[count];
}
m=count/2;
cout<<student[m];
cout<<"\n";
system("PAUSE");
return EXIT_SUCCESS;
}