Can someone please teach me how to do this...
if users Enter or Press 'y' the program will back to start ( in Enter Numbers ) or else the program will exit. Please i need this as soon as possible.....
Type: Posts; User: metaljacob
Can someone please teach me how to do this...
if users Enter or Press 'y' the program will back to start ( in Enter Numbers ) or else the program will exit. Please i need this as soon as possible.....
got it again..
printf("\nThe numbers generated are: \n");
printf(" %d ",n[0]);
do
{
n[i+1] = (a*n[i]+c)%m;
printf("%d ",n[i+1]);
now i get the correct codes...
int l;
l = n[i];
do
{
n[i+1]=(a*n[i]+c)%m;
#include <stdio.h>
#include <conio.h>
int main(void)
{
system("TITLE Pseudo Random Numbers");
system("COLOR a1");
system("COLOR f2");
char again;
no, i dont need the remainder.
I changed my codes a little bit..
#include <stdio.h>
#include <conio.h>
int main(void)
{
system("TITLE Pseudo Random Numbers");
system("COLOR 2");
Ok i did this
for(i = 1;i <= 19;i++)
{
nn[i] = (a*n[0]+c)/m;
n[i] = (a*n[0]+c)-(nn[1]*m);
}
still incorrect output..
Actually what i want to do is... the output will stop if the output is happened twice..
Example:
n=0( line 1 )= 2
n=1( line 2 )= 4
n=2( line 3 )= 1
n=3( line 4 )= 3
n=4( line 5 )= 7
n=5(...
this is my latest codes..
#include <stdio.h>
#include <conio.h>
int main(void)
{
system("TITLE Pseudo Random Numbers");
system("COLOR 2");
for(i = 1;i <= 19;i++)
{
nn[1] = (a*n[0]+c)/m;
n[1] = (a*n[0]+c)-(nn[1]*m);
}
it doesnt increment by 1.. why is it???
Thank's Sir Adak .. but would u mind if i request you to do the whole codes?? Thank you in advance.
Wow thanks a lot for that codes .. i love you thank you :))
Im still waiting to the answer in my question.. i love this forum:)
#include <stdio.h>
#include <conio.h>
int main()
{
system("TITLE Pseudo Random Numbers");
system("COLOR 2");
char again;
int a,c,m,x;