OK, now I'm starting to get the picture, here.
So you HAVE to use that probability function, that's settled.
It's the rest of the program that you're having a problem with, then.
Let's start with some rough logic:
And none of this is final code - it's just some idea's for how I think it could go. Fleshing out these details will give you a better understanding of how C works.
/* add your function prototypes here */
FILE = fp1 /* a file pointer for output */
for(i = 0; i < 2; i++) /* two files so an outer loop of 2 values */
if( i == 0)
VarNumber = 100;
fopen(100Num.txt, wt) /* open the 100 number file for writing text */
close the first file here.
VarNumber = 1000
fopen(1000Num.txt, wt) /* open the 1000 number file " " "*/
for(j = 0; j < VarNumber; j++)
r_number = probability() /*return random number, here*/
fprintf( print out r_number to the fp1 file stream) /*and print it to file, here*/
close the second file, here.
This is how I program, btw. First, idea's on a rough draft, then flesh it out and put off the details until later. Then insert all the details after the rough draft is in place, and don't be afraid to re-arrange the rough idea's, all around. Think of those idea's as "scaffolding" for your program.