View Single Post
Old 03-24-12, 02:33 AM   #5
smithdavid
*BANNED*
 
Join Date: Mar 2012
Posts: 2
Default Re: C programming issue

I am trying to do a few practice problems from C by Dissection and can't figure out this problem at all.


The problem asks "write a program that reads n integers into an array, then prints on a separate line the value of each distinct element along with the number of times it occurs. the values should be printed in descending order."

it gives the example that the user inputs:

-7 -7 3 3 5 -7

and the program prints:

5 occurs 1 times
3 occurs 2 times
-7 occurs 3 times


it also asks that I use dynamic memory allocation and pointer arithmetic


if anyone can figure out this program that would be greatly appreciated.
smithdavid is offline   Reply With Quote