Ok i made some progress, it previously wasnt giving me the exact number of digits less than the user input..thats ok now....but i have hit a stall and cant figure out what to do next....please help!!!
Code:
#include<stdio.h>
#include<stdlib.h>
int main (void)
{
int x,c;
double y,z,a,b,d,k=0,e,f,g,h,i;
FILE *input;
FILE *input2;
input=fopen("F:\\Eng c projects\\sentinal.txt","r");
input2=fopen("F:\\Eng c projects\\prenum.txt","r");
if(input==NULL)
{
printf("File Error");
}
printf("1=Sentinal.txt\n");
printf("2=Prenum.txt\n");
printf("Select File number:\n");
scanf("%i",&x);
if(x==1)
{
printf("File 1 selected.\n");
printf("Enter threshold value:\n");
scanf("%lf",&y);
for(c=-1;z>-990;k++)
{
fscanf(input,"%lf",&z);
if (y>z)
{
c++;
printf("count is: %i\n",c);
}
else
{
continue;
}
}
printf("The num of values less than threshold is:\n %i\n",c);
b=(c/(k-1))*100.00;
d=k-1;
printf("The percent of data below threshold is:\n %6.2fpercent.\n",b);
printf("Total number of data in file: %6.2f \n",d);
printf(" k value %f",k);
}
if(x==2)
{
printf("File 2 selected.");
printf("Enter threshold value:\n");
scanf("%lf",&y);
fscanf(input2,"%i",&b);
for(c=b;c<=b; )
{
fscanf(input2,"%lf",&z)
if (y>
}
}
system("pause");
return(0);
}