I have to create a random matrix m*n where m and n are user inputs.
Now i have to fill the matrix with random nos. Finally I must have a matrix where each value is either 0 , 1 , a fraction no between 0 and 1, and also sum of each column should be equal to 1. how should i create the matrix ??

thanks for help... :)

Re: generate n x n matrix with random numbers without fractions in C or C++ 80 80

Since I would write the code differently in C or C++ maybe you need to specify the target language first?

Plus, this question is on the web so there's that.

Re: generate n x n matrix with random numbers without fractions in C or C++ 80 80

I have to create a random matrix

You have to, so why should WE have to?
Show us your efforts, maybe we'll help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.