frequency problem,can u plz do the documentation for mi

Reply

Join Date: Oct 2006
Posts: 6
Reputation: neeven is an unknown quantity at this point 
Solved Threads: 0
neeven neeven is offline Offline
Newbie Poster

frequency problem,can u plz do the documentation for mi

 
0
  #1
Oct 31st, 2006
/*QUESTION 2*/
  1. /*Program to compute frequency of a list of marks obtained by a group of students*/
  2. #include <stdio.h>
  3. #define SIZE 100
  4. main()
  5. {
  6. /*define n as number of students.x[SIZE] is a array to store marks of students*/
  7. /*tempo[SIZE] is also used to store marks, but used in computation for frequency*/
  8. /*In tempo[SIZE], elements are first arranged in ascending order to facilitate
  9.   the computation of frequency*/
  10. int i, j, n, temp, x[SIZE], tempo[SIZE];
  11. /*read in the value of n, the number of students*/
  12. printf("\n How many students?");
  13. scanf("%d", &n);
  14. printf("\n\n");
  15. /*Ask user to input marks*/
  16. for(i=0; i<n;++i){
  17. printf(" MARKS %d:", i+1);
  18. scanf("%d",&x[i]);
  19. tempo[i] = x[i];
  20. printf("\n");
  21. } /*End of for loop*/
  22.  
  23. /*display for frequency*/
  24. /*reorder all array elements in ascending order*/
  25. for(i=0; i<n-1; ++i){ /*beginning of outer for loop*/
  26. /*find the smallest of all the remaining elements*/
  27. for(j=i+1; j<n; ++j){ /*beginning of inner for loop*/
  28.  
  29. if(tempo[j]<tempo[i]){
  30. /*interchange two elements*/
  31. temp = tempo[i];
  32. tempo[i] = tempo[j];
  33. tempo[j] = temp;
  34. } /*end of if statement*/
  35. } /*end of inner for loop*/
  36. } /*end of outer for loop*/
  37. /*computation of frequency*/
  38. printf("\t");
  39. return 0;
  40. }
Last edited by Salem; Oct 31st, 2006 at 2:59 am. Reason: Added code tags, learn to use them yourself
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,610
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 464
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: frequency problem,can u plz do the documentation for mi

 
0
  #2
Oct 31st, 2006
Arent the comments clear enough to make so that you can yourself do the documentation ?
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 6
Reputation: neeven is an unknown quantity at this point 
Solved Threads: 0
neeven neeven is offline Offline
Newbie Poster

Re: frequency problem,can u plz do the documentation for mi

 
0
  #3
Oct 31st, 2006
sorry i sent the wrong code..anyways can u help me...can u tell me another way of solvin this problem...this program allows input of number of students,marks for each student,the frequency for each mark, the interval between identical marks...
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,373
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1465
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: frequency problem,can u plz do the documentation for mi

 
0
  #4
Oct 31st, 2006
if you posted the wrong code then you need to post the correct code. We don't care if the code you posted doesn't work. Post the code you know how to do then we can talk about how to complete the assignment.

by "mark" do you mean "grade" ?

>>the interval between identical marks
what exactly does that mean?
Last edited by Ancient Dragon; Oct 31st, 2006 at 11:17 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC