

 Thread Tools  Search this Thread 
#1
 
 
Calculating Matrix Determinant in C Enter a 2x2 matrix of integers, calculate and display the determinant. Tables with more than two dimensions: Proceed in the same way by adding elements of design.That restores my C code but I don't know what is the problem in the code. Code: # include <stdio.h> # include <conio.h> int determinant (int m [1] [1]) ( return ((m [0] [0] * m [1] [1])  (m [1] [0] * m [0] [1])); ) void main () ( int M [1] [1], i, j; for (i = 0; i <= 1; i + +) for (j = 0 j <= 1 j + +) ( printf ( "Donez the value of M [% d] [% d]:", i + 1, j + 1); scanf ( "% d", & M [i] [j]); ) printf ( "and determine the% d", determinant (M)); getch (); return 0; ) 
#2
 
 
Re: Calculating Matrix Determinant in C Debug : Code: E: \ l Angaga C \ a \ main.c  13  warning: return type of 'main' is not `int ' E: \ C \ a \ main.c   In function `main ':  E: \ l Angaga C \ a \ main.c  25  warning: `return 'with a value, in function returning void  
#3
 
 
Re: Calculating Matrix Determinant in C For additional dimensions, we can easily do so by recursion (through the development of row or column), although this is not really optimal. 
#4
 
 
Re: Calculating Matrix Determinant in C Code: int main (void); and warnings disappears! in the running it gives: Code: Donez the value of M [1] [1]: 1 Donez the value of M [1] [2]: 2 Donez the value of M [2] [1]: 3 Donez the value of M [2] [2]: 4 and 5 determine the 

Tags: c progarm, determinant, matrix of integer 
Thread Tools  Search this Thread 

Similar Threads for: "Calculating Matrix Determinant in C"  
Thread  Thread Starter  Forum  Replies  Last Post 
New Matrix Movie (Matrix ReEntered)  Vicious  Off Topic Chat  8  08022011 08:24 PM 
Any fastest way to compute 3x3 Matrix inverse and Matrix multiplication?  Logan.B  Software Development  4  25092010 05:11 PM 
Calculating Age in java  Miles Runner  Software Development  5  03022010 01:54 AM 
Calculating identity matrix with static method in C  Measurer  Software Development  5  29012010 06:47 PM 
Calculating the sum of two polynomials  Liquid Shadow  Software Development  3  30112009 12:12 PM 