1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mash [69]
3 years ago
6

Write a C function check(x, y, n) that returns 1 if both x and y fall between 0 and n-1 inclusive. The function should return 0

otherwise. Assume that x, y and n are all of type int.
Computers and Technology
1 answer:
fomenos3 years ago
5 0

Answer:

<em>See comments for line by line explanation (Lines that begins with // are comments)</em>

<em>The function written in C, is as follows:</em>

//The function starts here

int check(x,y,n)

{

//This if condition checks if x and y are within range of 0 to n - 1

if((x>=0 && x<=n-1) && (y>=0 && y<=n-1))

{

//If the if conditional statement is true, the function returns 1

 return 1;

}

else

{

//If the if conditional statement is false, the function returns 0

 return 0;

}

//The if condition ends here

}

//The function ends here

Explanation:

You might be interested in
What is the difference between information poor and information rich<br>​
maw [93]

Answer:

The “Information poor” are consumers who use traditional mass media information such as television, DVDs, radios and magazines. ... On the opposite “information rich” stands for a new elite within the information society.

Explanation:

6 0
3 years ago
A license plate consists of 2 letters followed by 1 digit. How many license plates are possible if the first letter can be any l
Art [367]

Answer:

5400

Explanation:

  • As there are three spaces to be filled. First can have any alphabet, but not i and o. And there are 26 alphabets so, only one out of 24 can be filled in the first blank.
  • In the second blank any alphabet can be used, but not the one same as the first one so we can choose from the remaining 25 alphabets.
  • In the last blank any number can be chosen, but not 0 so we have 9 options to choose from.

Finally,the number of options available is <em>24*25*9 = 5400</em>. So, 5400 license plates can be made using these combinations.

8 0
3 years ago
Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to points Distance. The calculation is:
Nadusha1986 [10]

<u>Question:</u>

Snapshot of the question has been attached to this response.

<u>Answer:</u>

<u></u>

import java.util.Scanner;

import java.lang.Math;

public class CoordinateGeometry{

    public static void main(String []args){

       double x1 = 1.0;

       double y1 = 2.0;

       double x2 = 1.0;

       double y2 = 5.0;

       double pointsDistance = 0.0;

       

       //Declare a variable to hold the result of (x2 - x1)²

       double x;

       

       //Solve (x2 - x1)^2 and store result in the variable x

       x = Math.pow(x2 - x1, 2);

       

       //Declare a variable to hold the result of (y2 - y1)²

       double y;

       

       //Solve (y2 - y1)^2 and store result in the variable y

       y = Math.pow(y2 - y1, 2);

       

       //Now pointsDistance = SquareRootOf(x + y)

       pointsDistance = Math.sqrt(x + y);

       

       System.out.println("Points distance: ");

       System.out.println(pointsDistance);

       

       return;

    }

}

<u>Sample Output:</u>

Points distance:  

3.0

<u>Explanation:</u>

The above code has been written in Java and it contains comments explaining important lines of the code. Please go through the comments.

The snapshots of the program and a sample output have been attached to this response.

4 0
4 years ago
Create a cell reference in a format by typing in the cell name or
Neko [114]

Answer:

D. Create a cell reference in a formula by typing in the cell name or clicking the cell.

Further Explanation:

To create a cell reference in a formula the following procedure is used:

First, click on the cell where you want to add formula.

After that, in the formula bar assign the equal (=) sign.

Now, you have two options to reference one or more cells. Select a cell or range of cells that you want to reference. You can color code the cell references and borders to make it easier to work with it. Here, you can expand the cell selection or corner of the border.

Again, now define the name by typing in the cell and press F3 key to select the paste name box.

Finally, create a reference in any formula by pressing Ctrl+Shift+Enter.

6 0
3 years ago
Lập trình web truy vấn csdl và hienr thị ra màn hình danh sách các bản ghi
almond37 [142]

Answer:

ExplanatOverfishing occurs "when more fish are caught than the population can replace through natural reproduction," according to the World Wildlife . Once this occurs, the species is no longer "sustainable." Eighty-seven percent of all the world's fish stocks that we know about are at the "breaking point," according to the Environmental Defense Fund (EDF).

ion:

3 0
3 years ago
Other questions:
  • If it malfunctions and I can throw it, then it's a hardware problem; if I have to yell at it because there is nothing to pick up
    14·2 answers
  • The acronym LAH stands for
    14·2 answers
  • The Joint Photographic Experts Group developed the ___________ graphic format.
    12·2 answers
  • I play Among us :) hbu
    7·2 answers
  • How to program a concrete Damage-Plasticity material?
    5·1 answer
  • Who designed analatic engine in the 1930's?​
    10·1 answer
  • Write a method intersect that accepts two sorted array lists of integers as parameters and returns a new list that contains only
    8·1 answer
  • What is signature in an E-mail​
    10·1 answer
  • What is the protocol for getting to the Web?
    9·2 answers
  • With which type of satellite is there a propagation delay?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!