Abnormal program termination



I am facing that error message with no idea WHY the reason ? "Abnormal
program termination"



E:\programs\c_lang\iti01\tc201\ch06\own> arr01o01
Enter a number : 25
More numbers (y/n)? y
Enter a number : 30
More numbers (y/n)? n
25.000000
30.000000
The average is 27.500000
Abnormal program termination

E:\programs\c_lang\iti01\tc201\ch06\own>type arr01o01.c

/*#include <stdio.h>
/*-exercise 6.1.1 - calculate average of a series of numbers*/
main ()
{
float number[100];
int no_numbers,i;
float ave(),average;
input_nos(&no_numbers,number);
average=ave(no_numbers,number);
print_nos(number,no_numbers,average);
}

input_nos(count,nos)
int *count;
float *nos;
{
char another_no;
*count=0;
do
{
++(*count);
printf("Enter a number : ");
scanf("%f",&nos[*count]);
if (*count<100)
{
printf("More numbers (y/n)? ");
scanf("\n");
scanf("%c",&another_no);
}
}
while (another_no=='y'&&(*count)<100);
}


float ave(n_n,n)
int n_n;
float *n;
{
float total=0;
int i;
for (i=0;i<=n_n;i++)
total=total+n[i];
return(total/n_n);
}


print_nos(nu,n_n,a)
int n_n;
float *nu,a;
{
int i;
for (i=1;i<=n_n;i++)
printf ("%f\n",nu[i]);
printf ("\n The average is %f \n",a);
}

.



Relevant Pages

  • Re: Abnormal program termination
    ... More numbers (y/n)? ... Abnormal program termination ... int no_numbers,i; ... float ave,average; ...
    (comp.lang.c)
  • Re: Abnormal program termination
    ... foo.c:4: warning: function declaration isn't a prototype ... Your version is legal under C90 rules, but int mainis more explicit ... float ave(), average; ...
    (comp.lang.c)
  • RTF Render with Scale
    ... float fHorzSizeInches = nHorzSize / 25.4f; ... IntPtr hdc = graphics.GetHdc; ... int nHorzSize = SafeNativeMethods.GetDeviceCaps(hdc, ... PHYSICALWIDTH = 110, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: RAD vs. performance
    ... work with both int and float. ... name (e.g. "+" for both int and float addition). ... Again, it's a compatibility issue. ... contend that assuming interfaces are equivalent and inferring the most ...
    (comp.lang.misc)
  • (part1b) Han from China teaches you C
    ... int flist, mlist, slist; ... float board_size; ... static void draw_tube(float bottom_radius, float top_radius, ... glVertex3f(xmin, ymin, zmax); glVertex3f; ...
    (comp.lang.c)