Search:

Type: Posts; User: zmi

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,513

    Thank you for the idea.I managed to sort the...

    Thank you for the idea.I managed to sort the data. Now I'm having trouble to calculate the average of 'b' (sum/k).
    I got the sum, but don't know how to calculate the k value.

    Here's the code to...
  2. Replies
    4
    Views
    1,513

    for(i=0;i

    for(i=0;i<n;i++){
    fscanf(fin,"%f,%f\n",&a[i],&b[i]);
    }

    for(i=0;i<n;i++){

    if (a[i]==60){
    k=k+1;
    sum=sum+b[i];
    }
  3. Replies
    4
    Views
    1,513

    Complicated Condition

    Hi. I have a problem that I could not figure out. I have these datasets read from a textfile (1 to N):

    a1 b1
    a2 b2
    a3 b3
    :
    :
    aN bN

    I need to make this:
Results 1 to 3 of 3