¬† ¬† ¬† ¬† ¬†

# Linux.com

• Do you means array of number (integer))? If so, perhaps your array should be look like this in C/C++:

int num[5][5] =
{
{ -1, 12, 23, 4, 15 },
{ 16, 57, -8, 19, 0, },
{ 14, 22, -13, -14, 55 },
{ 10, 0, 2, 1, 20 },
{ 11, 22, -23, 14, 96 }
};

This is a 5x5 array of int, To determine the minimum value of 3rd row, you can use this loop:

int i, a, b;

a = num[2][0];
for (i = 1; i < 5; i++) {
b = num[2][i];
if ( a > b)
a = b;
}

after the loop end, the minimum value is now stored in a, and so with to find maximum value in a column, just change the row index and a more than '>' to less than '>'. Remember that C/C++ array always indexed from 0.

a = num[0][1];
for (i = 1; i < 5; i++) {
b = num[i][1];
if (a > b)
a = b;
}

Unfortunately i don't understand with 'triangle', but i hope this example give you a point to start.... AND I CAN'T WRITE CORRECT CODES HERE because it maybe re-formatted by this text-form.

 Answered by ajhwb 5 years ago 0 1
• nope

 Answered by ajhwb 5 years ago 0 0
• Hi Ardhan Madras ..and thanks for your answer .but when i try to run this program"with the Code Blocks compiler" an error message appears pointing to the statement
b=num[2]; saying that{ invalid conversion from int * to int}
so why is that? also there must be 2 loops instead of one ?

 Answered by linuxstarr 5 years ago 0 0
• the text from don't allow me to write such code, so use this link:

[url]http://pastebin.com/vZ6yhhT3[/url]

I will recomendeed you first to learn how to compile a program by not using an IDE such code::block, try to compile your code from command line, see your compiler documentation. That will help you to understand about the compiler and compilation itself.. good luck!

 Answered by ajhwb 5 years ago 0 1
• Why does this sound an awful lot like a homework assignment?

 Answered by gomer 5 years ago 1 0
• I think Adam is right

 Answered by kunal 5 years ago 0 0
Questions from category Internet
In Internet, asked by bkmishra 2 weeks ago
In Internet, asked by samir77 5 weeks ago
In Internet, asked by Arunprabha 5 weeks ago
In Internet, asked by doug_engel@yahoo.com One month ago
In Internet, asked by EFH-007 One month ago

### Latest Questions

 Does Linux keep my files? Storage crontab example? High Performance How will linux interact with a hdd formatted by windows? Desktop How do I put information on a TV screen? Audio/Video How to download application for mandriva? Applications

### Upcoming Linux Foundation Courses

1. LFD312 Developing Applications For Linux
05 Jan » 09 Jan - Virtual
05 Jan » 08 Jan - Virtual
3. LFD331 Developing Linux Device Drivers
12 Jan » 16 Jan - Virtual

View All Upcoming Courses

### Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

Blogs

Forums