Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Arbitrary - arithmetic precision Pin
Chris Losinger13-Nov-09 6:10
professionalChris Losinger13-Nov-09 6:10 
AnswerRe: Arbitrary - arithmetic precision Pin
Rajesh R Subramanian13-Nov-09 6:07
professionalRajesh R Subramanian13-Nov-09 6:07 
GeneralRe: Arbitrary - arithmetic precision Pin
nowrocktheworld13-Nov-09 6:31
nowrocktheworld13-Nov-09 6:31 
GeneralRe: Arbitrary - arithmetic precision Pin
nowrocktheworld13-Nov-09 7:55
nowrocktheworld13-Nov-09 7:55 
GeneralRe: Arbitrary - arithmetic precision Pin
Richard MacCutchan13-Nov-09 9:17
mveRichard MacCutchan13-Nov-09 9:17 
GeneralRe: Arbitrary - arithmetic precision Pin
Rajesh R Subramanian13-Nov-09 16:24
professionalRajesh R Subramanian13-Nov-09 16:24 
GeneralRe: Arbitrary - arithmetic precision Pin
nowrocktheworld14-Nov-09 1:20
nowrocktheworld14-Nov-09 1:20 
QuestionBubblesort help Pin
kbury13-Nov-09 4:44
kbury13-Nov-09 4:44 
Can someone please help me with my bubblesort. It does not seem to sort and also prints 3 times.


#include <stdio.h>
#include <stdlib.h>
#include<time.h>

#define SIZE 6
#define MAX 53

void printArray(int N[], int T);
void fillArray(int N[], int T);

int main()
{
srand(time(NULL));

int PICKED[] = {0,0,0,0,0,0};

fillArray(PICKED, SIZE);
printArray(PICKED, SIZE);

return 0;
}

void fillArray(int N[], int T)
{
for(int P=0; P<T; P++)
{
N[P] = (int) (rand()% 52+1);

for(int y=0; y<P; y++)
{
if(N[y] == N[P])
{
N[P] = (int) (rand()%52 +1);
P=-1;
}
}
}
}

void printArray(int N[], int T)


	{
		for(int P=0; P<SIZE-1; P++)

		{

			if(N[P]>N[P+1])

			{

				int T = N[P+1];

				N[P+1] = N[P];

				N[P] = T;


printf("\nLOTTO PICKS\n");
for(int P=0; P<SIZE; P++)

{
	printf("%d ", N[P]);


printf("\n");

}}}}

AnswerRe: Bubblesort help Pin
«_Superman_»13-Nov-09 5:03
professional«_Superman_»13-Nov-09 5:03 
AnswerRe: Bubblesort help Pin
David Crow13-Nov-09 5:06
David Crow13-Nov-09 5:06 
GeneralRe: Bubblesort help Pin
kbury13-Nov-09 6:37
kbury13-Nov-09 6:37 
QuestionRe: Bubblesort help Pin
David Crow13-Nov-09 6:40
David Crow13-Nov-09 6:40 
AnswerRe: Bubblesort help Pin
kbury13-Nov-09 6:48
kbury13-Nov-09 6:48 
QuestionRe: Bubblesort help Pin
David Crow13-Nov-09 7:42
David Crow13-Nov-09 7:42 
GeneralRe: Bubblesort help Pin
CPallini13-Nov-09 7:13
mveCPallini13-Nov-09 7:13 
GeneralRe: Bubblesort help Pin
kbury13-Nov-09 7:23
kbury13-Nov-09 7:23 
GeneralRe: Bubblesort help Pin
CPallini13-Nov-09 8:05
mveCPallini13-Nov-09 8:05 
Questionhow can i retrieve the desitnation path of the icons on the desktop Pin
nenfa13-Nov-09 2:02
nenfa13-Nov-09 2:02 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
David Crow13-Nov-09 3:12
David Crow13-Nov-09 3:12 
GeneralRe: how can i retrieve the desitnation path of the icons on the desktop Pin
nenfa14-Nov-09 20:27
nenfa14-Nov-09 20:27 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
David Crow15-Nov-09 8:28
David Crow15-Nov-09 8:28 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
«_Superman_»13-Nov-09 5:04
professional«_Superman_»13-Nov-09 5:04 
GeneralRe: how can i retrieve the desitnation path of the icons on the desktop Pin
nenfa14-Nov-09 20:25
nenfa14-Nov-09 20:25 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
nenfa14-Nov-09 22:18
nenfa14-Nov-09 22:18 
QuestionHow To Overcome DEBUG ASSERTION FAILED In VC++ Pin
ram8413-Nov-09 0:31
ram8413-Nov-09 0:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.