# Programming Challenge

Discussion in 'C Programming' started by candy_init@yahoo.com, Jan 4, 2005.

1. ### Guest

The aim is to make a program in C which can calculate the value of a
determinant of any specified order.The program should work in the
following way:
INPUT:
N: 5 (order of the determinant)
Enter the 25 elements

OUTPUT:
Value of the determinant.

Candice

, Jan 4, 2005

2. ### dandelionGuest

<> wrote in message
news:...
> The aim is to make a program in C which can calculate the value of a
> determinant of any specified order.The program should work in the
> following way:

For a "challenge" I would have picked something not as chewed out as
matrix-calculations. Are you sure you are not sneakily trying to

dandelion, Jan 4, 2005

3. ### GrumbleGuest

wrote:

> The aim is to make a program in C which can calculate the value of a
> determinant of any specified order.

Why don't you do your own homework?

Grumble, Jan 4, 2005
4. ### Chris CroughtonGuest

On 4 Jan 2005 03:53:25 -0800,
<> wrote:

> The aim is to make a program in C which can calculate the value of a
> determinant of any specified order.The program should work in the
> following way:

I don't know what you mean by 'determinant' in this case (matrices?
biology?), but it looks to me like homework. If you have a question
illustrating your problem, but we are not here to do your homework free
for you. On the other hand, if you wish to pay me...

Chris C

Chris Croughton, Jan 4, 2005
5. ### Guest

Determinant of a matrix is the modulus of it ie. |M|.
if M = [a b
c d] then

(I think)

, Jan 4, 2005
6. ### Chris CroughtonGuest

On 4 Jan 2005 05:41:15 -0800,
<> wrote:

> Determinant of a matrix is the modulus of it ie. |M|.
> if M = [a b
> c d] then
>
> (I think)

Maybe (I remember modulus, I don't remember it being the same as the
determinant, but it's been almost 30 years since I looked at the
terminology of matrices). However, we're not here to write the code for
matrix problems, that's the original poster's problem...

Chris C

Chris Croughton, Jan 4, 2005
7. ### Mike WahlerGuest

<> wrote in message
news:...
> The aim is to make a program in C which can calculate the value of a
> determinant of any specified order.The program should work in the
> following way:
> INPUT:
> N: 5 (order of the determinant)
> Enter the 25 elements
>
> OUTPUT:
> Value of the determinant.

Counter-challenge: TRY IT YOURSELF FIRST!

If you get stuck, post the code here, ask specific
questions, and you'll get plenty of help.

-Mike

Mike Wahler, Jan 4, 2005
8. ### -berlin.deGuest

wrote:
> Determinant of a matrix is the modulus of it ie. |M|.
> if M = [a b
> c d] then
> |M| = bc - ad

> (I think)

You got the sign wrong. And that's the formula for 2x2 matrices, things
get a bit more interesting for matrices of higher ranks. Bonus points
will be given for a program that deals reasonably with cases where the
determinante is near to zero but the matrix elements aren't;-)

Regards, Jens
--
\ Jens Thoms Toerring ___ -berlin.de
\__________________________ http://www.toerring.de

-berlin.de, Jan 4, 2005