Yes i understand, I did not mean to type that in this forum.
Type: Posts; User: tysawyers13
Yes i understand, I did not mean to type that in this forum.
I am just not entirely sure how to store the value of the getPascalsTriangle in a pointer to a pointer? As in the other thread he does not store it in a pointer.
I have to write a program to print pascals triangle and stores it in a pointer to a pointer , which I am not entirely sure how to do. I also have to write the file and read it, then create a binary...
It is working fine now, thank you very much!
Okay, so everything is working but the above average function. I put it in another function but it still won't give me the right answer.
void aboveAverage(double average, int num_elements,...
I must write a function that has a one dimensional double array and the number of values in the array as its arguments. Normalize the values. I must also print the maximum, minimum, average and...
Okay i am pretty sure I have it now, thanks a lot !
I mean if new door was equal to 0 then you lost.
So I must change the last if statement? I thought that if new door would be equal to 1 then it should be true?\
if (choice==1)
newdoor = choice;
else if (choice==2)
...
Yes i have changed that, but now I get a winning answer an unlikely amount of times?
How would I get the program to find the only remaining door if the prize is in the door you choose before the first door is opened?
Actually i get that if you change your door you always win.
Yes that makes a lot of sense, don't know why I did that.. But now when I run the program I always get the result of winning? Is there something wrong with my random number generator then?
#include <stdio.h>
#include <stdlib.h>
void game()
{
int door[3]={0,0,0};
int choice, i, newdoor, originaldoor, openeddoor, randomnumber;
Okay so i have fixed all those errors but I still do not get correct results. I also did not get any errors or warnings for my earlier code.
I have fixed that but it is still not working properly
#include <stdio.h>
#include <stdlib.h>
int game()
I am pretty sure there is still a problem with the random number though
This is what I have now, I am still working on the final part of the loop:
#include <stdio.h>
#include <stdlib.h>
int game()
I was told that "door[randomnumber] = 1; " would randomly put the prize behind the door..
Okay, now i just don't know how to open a random door..
Okay, so if you have the prize in the original door you picked there would be 2 doors to open?
Again I have basic knowledge of programming, so this is very difficult for me and I know that this code is incorrect.
Okay, so I still do not understand how to tell if there are two doors available or how to get the program to open a door but this is what I have
#include <stdio.h>
#include <stdlib.h>
...
That is the part I am confused about, deciding which door to open.
Scratch the printf statement on line 17.