| | |
help me on my case study!!!
![]() |
•
•
Join Date: Feb 2006
Posts: 3
Reputation:
Solved Threads: 0
i have a case study....
my prof said that we should display 10 random numbers without repeating the same number for example the screen will print numbers from 0-9 at this order
1 6 7 5 2 3 4 9 8 0
then when we exit the program it should print another random number... plss help i needed it very badly :cry: :cry: :cry:
tanx...
my prof said that we should display 10 random numbers without repeating the same number for example the screen will print numbers from 0-9 at this order
1 6 7 5 2 3 4 9 8 0
then when we exit the program it should print another random number... plss help i needed it very badly :cry: :cry: :cry:
tanx...
•
•
Join Date: Feb 2006
Posts: 3
Reputation:
Solved Threads: 0
ahm... my idea is having a 3 for loop the first loop will generate the 10 random numbers from 0-9 and the second loop will check if the number that was generated before is already in the array and it will check if the it is the last in the array,if it generate the second number and compare it to the first number and it check that it is the same it will generate again...i need a counter in this program but i dont know hoe to do the second loop im thingking of doing a while loop instead of for loop
•
•
•
•
Originally Posted by tomoyo_13m
ahm... my idea is having a 3 for loop the first loop will generate the 10 random numbers from 0-9 and the second loop will check if the number that was generated before is already in the array and it will check if the it is the last in the array,if it generate the second number and compare it to the first number and it check that it is the same it will generate again...i need a counter in this program but i dont know hoe to do the second loop im thingking of doing a while loop instead of for loop
int array[]= {0,1,2,3,4,5,6,7,8,9}
Then randomly pick two index values and swap their contents.
Keep going until the array is sufficiently randomised, then print out the solution.
And this is the exact procedure used for deck shuffling programs to avoid rolling out a repeat. :rolleyes:
*Voted best profile in the world*
![]() |
Similar Threads
- plss help me with my case study...... (C)
- Help me out in Case study for DBMS project of Insurance policies (MS SQL)
- case study help please (Networking Hardware Configuration)
- Marine Biology Case Study (Computer Science)
- new implementation (C++)
- Zodiac sign (VB.NET)
- Case Study in VB.Net (VB.NET)
- Ethical Dilemma: Malpractice in the workplace - What would you do? (IT Professionals' Lounge)
Other Threads in the C Forum
- Previous Thread: Audio measurement dll using sound card?
- Next Thread: conversions to int/double/etc...
| Thread Tools | Search this Thread |
* adobe ansi api array arrays binarysearch calculate centimeter char character cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking highest homework i/o inches incrementoperators intmain() iso km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. lowest match matrix microsoft mqqueue mysql oddnumber odf open opendocumentformat openwebfoundation pattern pdf performance posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h windowsapi






