Programming Challenge

C

candy_init

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
 
D

dandelion

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
social-engineer your way out of your homework-assignments?
 
C

Chris Croughton

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
about the C language itself, please post it preferably with code
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
 
P

petermcmillan_uk

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

(I think)
 
C

Chris Croughton

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

(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
 
M

Mike Wahler

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
 
J

Jens.Toerring

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top