Question :)

How to Resolve this ? :
"Format an array size 10 * 10 random numbers.
Sort the triangle bottom left and upper right triangle with a 'sort of income'."
I ain't know how to do this... pls hlp.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here's what I got :
---------------------------
#include <iostream>
using namespace std;
int main (){
int arr1[10][10];
int i,j,k;
for (i=0;i<10;i++){
for (j=0;j<10;j++){
k=i-j;
if(k<0){
cout<<"+";}
else if(k>0){
cout<<"-";}
else{
cout<<"0";}}
cout<<endl;}
system("PAUSE");
return 0;}
--------------------------------------------
I ain't shore its right...
I dont get the " 'sort of income' " thing ...
Plus.. i cant remember how to do the "random" numbers...
Last edited on
Look up srand() and rand() for random numbers.

The other part I haven't got a clue what you're asking.
Uhh, what are you trying to do exactly? Also, be sure to put that code in code tags.
Topic archived. No new replies allowed.