Design a program that has a two-dimensional integer array with 7 rows and 7 columns. The program should store a random number in each element. Then, the program should search the array for saddle points. A saddle point is an element whose value is less than or equal to all the other values in the same row, and greater than or equal to all the other values in the same column.

Answers

Answer 1

Answer:

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

int saddle_Point_Value(int n, int arr[n][n])

{

int row, col = 0;

int k;

for (int i = 0; i < n; i++) {

    row = arr[i][0]

    col = 0;

    for (int j = 1; j < n; j++) {

        if (row > arr[i][j]) {

            row = arr[i][j];

            col = j;

        }

    }

    for (k = 0; k < n; k++) {

       if (row < arr[k][col])

           break;

    }

    if (k == n) {

        printf("\nThe saddle point value is : [%d]\n", row);

        return 1;

    }

  }

  return 0;

}

int main()

(

   int n = 7

   int arr[n][n];          //Declaring 7 x 7 array

   int i, j;

   //Creating random numbers

   for (i = 0; i < n; i++) {

      for (j = 0; j < n; j++) {

         arr[i][j] = rand()%50; //Random numbers up to...

      }

   }

   printf("\n Array elements :\n ");

   for (i = 0; i < n; i++) {

      for (j = 0; j < n; j++) {

         print("%d\t", arr[i][j]);

      }

      print("\n");

   }

   if (!(saddle_Point_Value(n, arr)))

        printf('No Saddle Point.!!\n");

   return 0;

}

Explanation:

A properly functioning and running code is written in the answer. Just follow the steps.


Related Questions

which World tool will allow you to quickly count number of words in your document
A) Thesaurus
B) Show and hide
C) word count
D) line spacing ​

Answers

I think the answer will be B

In three to five sentences, explain the function of the computer's operating system.

Answers

Answer:

An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Explanation:

An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

What is header?

A header has been known as the line or block of text appearing at the top of each page of a book or document. in Hyper Text Markup Language(HTML). a header tag is found at the top of a web page. it usually contains a logo, search, navigational links.

A footer is a line or block of text appearing at the foot/bottom of each page of a book or document in HTML, a footer for its nearest sectioning content or sectioning root element. A footer typically contains information about the author of the section, copyright data or links to related documents.

Therefore, An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Learn more about HTML on:

https://brainly.com/question/15093505

#SPJ2

Which components are involved with input? Output? Processing? Storage?

Answers

Answer: Output

input keyboard mouse joystick graphics tablet trackball touchpad touchscreen microphone sensor      

Processing     processor (CPU) processor (GPU) memory motherboard

Output printer monitor touchscreen plotter speakers headphones motor data projector

Explanation:

In Computing the various component responsible for input, Output, Processing, Storage is listed bellow

Input:  They are devices used to provide data for processing

keyboards, mouse, scanners, cameras, joysticks, and microphones.

Output: These are devices that send already processed data

monitors, printers, speakers, headphones, projectors, GPS devices, sound cards, video cards.

Processing: Processing devices are the components responsible for the processing of information within the computer system.

CPU, memory and motherboard.

Storage: Storage devices are components that allow data to be stored within a computer system.

Hard Disk Drive, ROM, RAM

Learn more:

https://brainly.com/question/1113609

A sample of 30 households showed that the sample mean of back-to-school spending is $622.85. It is believed that back-to-school spending is normally distributed with a population standard deviation of $65. An analyst wishes to test if the average back-to-school spending differ from $606.40 per family predicted by the trade group at the 5% significance level.

Answers

The text editor is not letting me submit my typed answer.Please check attachment

The pvalue is 1.646 which is greater than the level of significance 0.05

This tells us to accept the null hypothesis.

P-value is 0.1646 > significance level.

We do not reject the null hypothesis.

So we can not say that average back to school spending is different from 606.4 dollars per family

What is a variable? Why is it helpful in programming?

Answers

Answer:

Variables can represent numeric values, characters, character strings, or memory addresses. Variables play an important role in computer programming because they enable programmers to write flexible programs. Rather than entering data directly into a program, a programmer can use variables to represent the data.

Explanation:

Hey guys!

Just a quick question I’m not 100% sure about

T/F

ROM stores data that the user is currently working on.

Thank you so much!!

If you can’t help here iz a happ kat :)


Answers

Answer:

YESSS!!

Explanation:

LUV THE CAT

Answer:

beautiful kitty........

Define the following
chatting
browsing
E-commerce​

Answers

Answer:

- chatting: real-time communication via keyboard between two or more users on a local network (LAN) or over the Internet.

- browsing: refers to reading and scanning through data; commonly used to describe when a user reads through pages on the Internet and is also often referred to as surfing.

- e-commerce: commercial transactions conducted electronically on the internet.

One solution for communicating indentations and the distinction between code and text is the use of _____.
A. text-to-speech
B. audio cues
C. screen readers
D. a tree structure

Answers

A. text-to-speech is the answer,that is the disto

What does the term Gestalt mean? A. image B. graph C. big D. part E. whole

Answers

Answer:

Part E

Explanation:

an organized whole that is perceived as more than the sum of its parts.

Answer:

E. whole

Explanation:

i got it right

Which of the following improved networks by increasing speed or by improving the ability for businesses to use networks? Check all the boxes that apply.

Ethernet

ISDN

Minicomputers

Gigabit Ethernet

Answers

Answer: ethernet, isdn, gigabit ethernet

Explanation:

Answer:

Ethernet, ISDN, minicomputers, Gigabit Ethernet

Explanation:

Which of the following is a system management tool?

Answers

What’s are the options??

Answer:

its a firewall

Explanation:

2 4. What is one way to prepare for building a project budget? (1 point)​

Answers

Answer:

Limit the amount of supplies you use

Explanation:

If you limit the amount of supplies you use then you could have extra money to do what ever you want with it.

2) Prompt the user for his/her favorite 2-digit number, and the output is the square root of the number.

Answers

num = int(input("What's your favorite 2-digit number? "))

print("The square root of {} is {}".format(num, (num**0.5)))

I hope this helps!

Other Questions
The British strategy changed to one of trying to ___ the American people by blockading the ports.A. encourageB. injureC. discourageD. killE. recruitthank you if you helped ............................... 5+5 =? 1) What is the ground state electron configuration for Oxygen (O)? 2) What is the excited state electron configuration for Oxygen (O)Help please It is believed the that the Appalachian Mountains used to reach heights of nearly 20,000 feet. Over the last 300 million years since the mountains were formed, there has been enough erosion to flatten the mountains. However, despite all of the erosion, Virginia still has its mountain ranges. Which is NOT a major cause of the erosion of the mountains? A)water run-off B)wind C)coal mining D)rain Congress passed the sedition act during ww1. under this law, Americans could be jailed for - NEED ASAP !!!! Refusing to purchase war bonds Selling goods to an enemy nationSpeaking out in public against the war Violating the nations policy of neutrality what is a Coatimundi?and if anyone plays Fortnite pls comment and read the following thing belowuh so I know this is not an academic question but does anyone on here play Fortnite me and my best friend are going to try to get ghost rider tonight but we only need one more person to do trios maybe. (we play on NA-West and you don't need a mic I guess im not sure ill give you more info when my friend wakes up) 13-year-old Judy is poor at math. Her teacher, Ms. Kobes, helps her out by providing her with a list of tips and tricks that she can use to become more proficient at the subject. According to Vygotskys Sociocultural Theory, Ms. Kobes is using _____ to help the child. Sweat glands that cause odors during puberty are present in the body from the time of birth. t or f 4. Why do we not include the electrons in determining the mass of the atom? Which is the factorization of 8x2 + 13x 6 Choose the word that best completes each sentence.Angiosperms anchor them in the ground and absorb water for the plant. Their stems provide support to the plant and connect the roots and leaves. Their ------capture the suns energy and use it to make food through the process of photosynthesis. Angiospermscontain the reproductive parts of the plant.Their protect and help spread the seeds. alr i got questions is needing help with a research paper practice when I have no websites to go on that were given to by my teacher I got one source and multiple sources and i cant go to them but i get reported for asking a question on something like bruh just why In a tug of war , two teams pull on the rope with a certain force. If team A pulls on it with a force of 225 N and team B pulls on it with a force of 360 N, what is the magnitude of the resultant force on the rope? A recipe for cupcakes calls for 4 5/7 cups of flour. Dan accidentally put 5 5/6 cups. How many extra cups did he put in? What does this excerpt reveal about the setting of the story?It is a work site with dangerous equipment.It is a tourist destination with unfamiliar sights.It is a more heavily populated town than Buck has ever seen.It is a colder climate than Buck has ever experienced. What is the domain and range? Is the relation a function? Explain why or why not. {(2, 0), (5.0), (0.5), (0, 2)} When your body lacks sleep is it like being impaired by alcohol? Shang bronze objects included: You hear a kid say "I think i'm gonna end it all." what do you do How can you tell what kind of compound inequality an absolute value inequality will represent?