|
|
|
Help me with my assignment!
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2006
Posts: 3
Reputation:
Solved Threads: 0
Hi,
I have given a assignment to make a program using arrays input match played and win for five cricket teams in the month of April then give the ratings of the teams like “CITY BANK CRICKET RATING�.
So far I have done this:
But there is something wrong sorting, I couldn't figured out yet. I tried everything I could but no result.
Please Please tell me what should I do to make it work.
Waiting for reply.
I have given a assignment to make a program using arrays input match played and win for five cricket teams in the month of April then give the ratings of the teams like “CITY BANK CRICKET RATING�.
So far I have done this:
C Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> void main (void) { int a,ab[5,2],ad[5],b; float ac[5],ae[5]; clrscr(); printf("\nfive teams are: \n1.pakisatan\n2.south africa\n3.india\n4.australia\n5.england"); for (a=0;a<=4;a++) { if (a==0) printf("\n\t\tpakistan"); if (a==1) printf("\n\t\tsouth africa"); if (a==2) printf("\n\t\tindia"); if (a==3) printf("\n\t\taustralia"); if (a==4) printf("\n\t\tengland"); printf("\nmatch played: "); scanf("%d",&ab[a,0]); printf("\nwin: "); scanf("%d",&ab[a,1]); ac[a]=(ab[a,1]*100.0)/ab[a,0]; ae[a]=ac[a]; printf("\nwin percent is %.2f",ac[a]); } for (a=0;a<=4;a++) { ad[a]=0; for (b=0;b<=4;b++) { if (ac[a]<ac[b]) ad[a]=b; } ac[ad[a]]=0; } clrscr(); printf("\t\tCITY BANK CRICKET RATINGS"); printf("\n\t\t________________________"); printf("\n\n\n\t\tteams\t\twin percent"); for (a=0;a<=4;a++) { if (ad[a]==0) printf("\n%d\t\tpakistan\t\t\t%.2f",a+1,ae[ad[a]]); if (ad[a]==1) printf("\n%d\t\tsouth africa\t\t%.2f",a+1,ae[ad[a]]); if (ad[a]==2) printf("\n%d\t\tindia\t\t\t%.2f",a+1,ae[ad[a]]); if (ad[a]==3) printf("\n%d\t\taustralia\t\t%.2f",a+1,ae[ad[a]]); if (ad[a]==4) printf("\n%d\t\tengland\t\t%.2f",a+1,ae[ad[a]]); } getch(); }
Please Please tell me what should I do to make it work.
Waiting for reply.
![]() |
Similar Threads
- Java Assignment Help Needed!!!!!!!!!! (Java)
- Help needed with VB Assignment (Visual Basic 4 / 5 / 6)
- Many Errors while doing this assignment (C)
- I need help on my 'address book' assignment! (C++)
Other Threads in the C Forum
- Previous Thread: Add-In is un-known from within its button obj
- Next Thread: Quick Sort Program
| Thread Tools | Search this Thread |
Tag cloud for C
#include * append array arrays asterisks binarysearch calculate changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fflush fgets file fork forloop framework function givemetehcodez grade gtkwinlinux hacking histogram homework inches include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft motherboard mqqueue number oddnumber odf opendocumentformat opensource overwrite owf pdf performance pointer posix problem probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket socketprograming spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi






