Connecting Tech Pros Worldwide Forums | Help | Site Map

Program to find average, min and max

Newbie
 
Join Date: Oct 2007
Location: kuwait
Posts: 3
#1: Oct 7 '07
I want to write a program that read n numbers and perform some mathematical tasks on them. The task available for the user is as follow :

1- Finding the average
2- Find the maximum number
3- Find the minimum number
4- Sort the numbers: store the sorted numbers in different memory location

Use pointers. DO NOT USE ARRAY. All program should deal with pointers. Use pointer/offset notation only. Do not use pointer/subscript notation.

(( use function to do that ))

it's realy hard problem :(

Expert
 
Join Date: Aug 2007
Posts: 674
#2: Oct 7 '07

re: Program to find average, min and max


What's your question?
Newbie
 
Join Date: Oct 2007
Location: kuwait
Posts: 3
#3: Oct 7 '07

re: Program to find average, min and max


I want any one can help me to solve this problem
Ganon11's Avatar
Moderator
 
Join Date: Oct 2006
Location: New York, United States of America
Posts: 3,428
#4: Oct 8 '07

re: Program to find average, min and max


Sure, we'd love to help you. So...what part are you having trouble with?

P.S. If you say, "All of it!" we will politely ask you to at least try first. We're not here to do your homework for you - only to help you out.
Newbie
 
Join Date: Oct 2007
Location: kuwait
Posts: 3
#5: Oct 8 '07

re: Program to find average, min and max


ok

to be specific my question is

how do i use sorting in pointer i want the idea !
Expert
 
Join Date: Aug 2007
Posts: 674
#6: Oct 8 '07

re: Program to find average, min and max


Quote:
how do i use sorting in pointer i want the idea !
Well, you know how to sort an array right? Since the objective of this assignment is to use pointer notation, in your sort method, don't use array subscript notation, change it's representation to pointer notation. That's about it.

If you're confused, it's for two reason:
1) You don't know how to sort an array. Have you covered sorting algorithms in class?
2) You don't know how to use pointer notation with an array. You need to do some reading.
Reply