This is a discussion on please...help me n building football league.....i really really stuck... within the C Programming forums, part of the General Programming Boards category; this programming still not perfect....
i'm actually want to create football fixtures and user can input how many team will ...

this programming still not perfect....
i'm actually want to create football fixtures and user can input how many team will play...then..they can see the table...
follow the ranking based on their point...

(it need to input all score every match so you can see the proper table if not some weird number appear)

Everything that currently has a hard-coded limit, like the four goal variables, and the six d/l/w variables, and the six game input prompts, etc., will have to become arrays. If you're allowed C99, you can use VLA to declare those arrays after you've input how many teams there are. Input and computation will then have to be in loops rather than a hard-coded number of calls.

You'll also have to rethink your structure, as your d/l/w variable conceit won't extend to more teams at all, nor will your functions. You'll have to compute the total wins, total losses, etc. for each team as the data is input.

Now just go through the teams and scores arrays, very similarly to what was done for the output() function, and add the names of each teams from the teams array, tally up the wins and losses for each team from the scores array, and put that data into your array of structs.

Now sort the structs in this array[], according to their number of wins, in descending order. For this small a number, bubblesort will be faster than most other sorting algorithms: