1. program to find the saddle point of a matrix ??

Write a program to find the saddle point of a matrix ( a[i][j] is the smallest value in th ith row and the largest alue in the jth column

2. So write it.

3. pls write this program for me

use c not c++. use a function named saddle to do the process. pls help. Today is the last day to submit the work.

4. Nobody here is going to do your homework for you. If you put in some effort and show your code, people will guide you along and provide hints to fix it and make it work.

Even if today is the last day to submit it if you start working on it now, it will probably only take you about 1-2 hours to get it done, and that includes the time it takes to post your intermediate code here.

5. i have done it. but need u r help

i will post the code here

Code:
```saddlepointa(int a1[10][10],int rowa,int cola)
{
int big[10],small[10],i,j,max,min;
clrscr();
big[0]=a1[0][0];
for(i=0;i<rowa;i++)
{
for(j=0;j<cola;j++)
{
if(a1[i][j] > big[i])
{
big[i] = a1[i][j];
}
}
}
for(j=0;j<cola;j++)
{
small[j]=a1[0][j];
for(i=0;i<rowa;i++)
{
if(a1[i][j] < small[j])
{
small[j]=a1[i][j];
}
}
}
min=big[0];
for(i=0;i<rowa;i++)
{
if(big[i] < min)
{
min = big[i];
}
}
max=small[0];
for(j=0;j<cola;j++)
{
if(small[j] > max)
{
max = small[j];
}
}
if(max==min)
{
printf("\n\n\n\t\t\tTHE SADDLE POINT IS --> %d ",min);
}
else
{
}
getch();
return 0;
}
void main()
{
int a[10][10],i,j;
printf("Enter the matrix elements\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
getch();
}```

6. Post the code using CODE TAGS! Nobody will read that.

7. Post ok ?

is the post ok ?

if we enter

1 2 3
4 5 6
7 8 9

The program will return 3 as saddle point.
but according to question the answer is 7

pls help to correct this

8. Post is OK, (much better!).

Let's see...

I don't understand your logic, but here's one way:

sort the array, in descending order.

The value in the last row, zero column, will always be the saddlepoint.

9. Originally Posted by intermediatech
is the post ok ?

if we enter

1 2 3
4 5 6
7 8 9

The program will return 3 as saddle point.
but according to question the answer is 7

pls help to correct this
The correct answer is 7, because 7 is the smallest on its row (row 3) and largest on its col(col 1).

10. help ?

can u help ?

11. Your saddlepoint function finds largest in the row and smallest in the column. If you want it the other way around, then you should go the other way with your tests.

12. can u do it ?

i am having head ache with it. I am very low in logic. i need help.

13. I'm not sure why you have so many loops. Loop once through the provided column. Store the biggest, or smallest or whatever it is you're looking for, the index of that value. Do the same thing for the row. Return the value that is at the coordinates those two indexes make.
Code:
```for each element in this column
if here < or > (whatever) than previous low or high
update stored column index

for each element in this row
if here < or > (whatever) than previous low or high
update stored row index

return array[ stored row index ][ stored column index ];```
You have twice as many loops as you need, unless I'm misunderstanding what you're really trying to do. Also, your code doesn't actually spit out 3, because your code doesn't actually ever call your saddle function.

Quzah.

14. Tell me the steps to do ?

steps to do ...

15. Code comes from here.

Loser. Do your own friggin homework.