Bonjour,
je voudrais savoire comment chercher la valeur max de la premiére ligne et de la premiére colonne d'une matrice qui sera le pivot du systéme à resoudre pour cela voici ce que j'ai deja fait mais y'a un probléme quelque part et je voudrais que vous me le corrigé.
#include<stdio.h>
#include<conio.h>
#define MAX 4
int cherchePivot(int tab1[][MAX]);
int main()
{
int pivot;
int tab[MAX][MAX];
int i , j;
printf("Donnez les elements de la matrice:\n");
for(i=0 ; i<MAX ; i++)
{
for(j=0 ; j<MAX ; j++)
{
scanf("%d",&tab[i][j]);
}
}
pivot=cherchePivot(tab);
getch();
return 0;
}
int cherchePivot(int tab1[][MAX])
{
int i ,j ;
int pivot;
pivot=tab1[0][0];
for(j=0 ; j<MAX ; j++)
{
for(i=0 ; i<MAX-1 ; i++)
{
if (tab1[i][0]>tab1[j][0])
{
pivot=tab1[i][0];
}
}
}
printf("Pivot=%d",pivot);
return pivot;
}
Merci de m'aider je compte sur vous