Thank you for all your help but I expected a program like this:
nk — ImgBB
This example shows that if you input 6 numbers the program shows you the chances in percentage of winning or losing....
Type: Posts; User: wolly
Thank you for all your help but I expected a program like this:
nk — ImgBB
This example shows that if you input 6 numbers the program shows you the chances in percentage of winning or losing....
Ok,but how is that suppose to help me if I want to pick 6 numbers and not 49?
@Salem I tried solving the issue with the random function and I am uncertain of myself if my method was correct or wrong. I wrote the code but it's a different shuffle.
Here is the code:
int...
Ok,but how is that going to help me input 6 numbers and check if the input I gave is right or wrong?
I only know to create an array of 6 elements but I don't know how I could continue
int...
int main() {
int lotto[49] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15, 16, 17, 18, 19, 20, 21,22, 23, 24, 25, 26, 27, 28,29, 30, 31, 32, 33, 34, 35,36, 37, 38, 39, 40, 41, 42,43, 44, 45,...
Now,I have another issue:
int lotto[49] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15, 16, 17, 18, 19, 20, 21,22, 23, 24, 25, 26, 27, 28,29, 30, 31, 32, 33, 34, 35,36, 37, 38, 39, 40, 41,...
Thank you for the help,@Salem. I'm a bit confused about what you said with arrays
For example if I would create an array like this and I refuse to use the for loop would that be a problem?
int...
#include<stdio.h>
int main() {
int a[6],v[6];
srand(time(0));
int ok=1;
for(int j=1;j<=6;j++){
int n= 1+(rand()%49);
int v[j] = n;
}
for(int i=1;i<6;i++)
But you specified that I should be doing 49 elements and not 50. Am I not correct?
It's my first time in programming and this is a partial code,it's not done:
int numbers[49];
for(i=1;i<=49;i++)
numbers[i]=i;
I don't know how to continue
New advices....?
Anyone?
In all your examples you used arrays,functions,outputs but they seem too complicated. Don't you have steps that are a lot easier than what you showed me?
Thanks you for all your comments but when I typed select 6 numbers I meant that you use the scanf function to input 6 numbers and to check if these are the winning or losing numbers.
When you placed High NUM 49 and you added one did you used 0 as a first number?
I thought 0 is a number that is not played in this game but I'm not sure.
And some steps?
I found something like this,is this a good start?
''To pick lotto numbers, you make a pool (an array) of available numbers, pick one of them (an index) at random, and remove that...
Hi I need some help for my program and I don't know how to start. I want to create a program which generates 6 numbers from a range of 1 to 49. How can you create that?
Also,is it possible to...