hello i want to make a 2d array using variables and to generate random values in it which is the probability of programme.as user enter three integers m,n,p.m and n make a 2d array and the random values are generated according to probability p entered by user.but i am getting some trouble,kindly tell me what is the right way to do it,
when size of array is given by user mean a[m][n];then my code is here
#include<iostream.h>
#include<conio.h>
int rand ();
void main ()
{
clrscr();
int m,n=0;
cout<<"enter two numbers";
cin>>m>>n;
int a[m][n];
int p=0;
cout<<"enter probability";
cin>>p;
for(int i=0;i<m;i++)
{
for(int j=o;j<n;j++)
int [i][j]=rand();
}
for(int i=0;i<m;i++)
{
for(int j=o;j<n;j++)
cout<<a[i][j];
}
getch();
}