Content deleted Content added
→See also: cleaned up code. |
|||
Line 17:
#include<iostream.h>▼
void main()▼
{▼
int n=0,a,c,m,Z[100];
▲#include<iostream.h>
float U[100];▼
▲void main()
cout<<"enter z "<<endl;▼
▲{
cout<<"enter a "<<endl;▼
▲float U[100];
cin>>a;▼
▲cout<<"enter z "<<endl;
cout<<"enter c "<<endl; ▼
cin>>c;▼
▲cout<<"enter a "<<endl;
cout<<"enter m "<<endl;
▲cin>>a;
cin>>m; ▼
▲cout<<"enter c "<<endl;
cout<<"n"<<"\t"<<"Zn"<<"\t"<<"Un"<<"\t"<<endl;▼
▲cin>>c;
cout<<"
do {
▲cin>>m;
Z[n+1]=((Z[n]*a)+c)%m;
▲cout<<"n"<<"\t"<<"Zn"<<"\t"<<"Un"<<"\t"<<endl;
cout<<"..."<<"\t"<<"..."<<"\t"<<"..."<<"\t"<<endl;▼
else▼
▲ if(Z[n+1]!=0)
▲ U[n+1]=(float)1/(Z[n+1]);
n++;▼
▲else
} while(Z[n
}▼
▲n++;
▲}
|