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
PolarNik [594]
3 years ago
11

Write a function that accepts two pointers; one to the first element and one to the last element of an integer array. The functi

on returns how many numbers are negative in the array. Use only pointer notation.
Computers and Technology
1 answer:
algol133 years ago
6 0

Answer:

The code to this question can be defined as follows:

int count(int *first, int *last)//defining a method count that accepts two integer pointer    

{

   int c=0;//defining integer variable c

   while (first <= last)//defining a while loop that counts first to last value  

   {

       if (*first < 0)//use if block to check negative value

           c++;//increment variable value

       first++;//increment first parameter value

   }

   return c;//return c value

}

Explanation:

In this code, a method "count" is declared that accepts two pointer variable "first and last" as the parameter, inside the method an integer variable "c", and a while loop is declared that counts values, and inside this an if block is used that counts the negative value and increment its value, and also increments the first parameter value, and return c value.      

You might be interested in
Why should programmers use a Post Mortem Review?
Zina [86]
The goal of a postmortem is to draw meaningful conclusions to help you learn from your past successes and failures. Despite its grim-sounding name, a postmortem can be an extremely productive method of improving your development practices.
8 0
4 years ago
Write down the importance of computers in this modern era of information technology in brief.​
Whitepunk [10]

Explanation:

The computer system is not a simple machine. It is like a very modern and highly complex calc ulator. It can do

Computers are critical for communication and are the centerpiece of information technology. The early 1990s saw the emergence of household Internet use, which eventually spurred common use of email, we bsites, blo gs, social network ing, video c hat and Voice-Over-Inte rnet Protocol.

4 0
2 years ago
Think about your favorite technology item - phone, game, smartTV, etc. - Write about how your favorite technology item has impac
grandymaker [24]

Answer:

that is about you you put what are the good and the bads of nechnoilogy

4 0
3 years ago
Why is it important not to leave your personal information on a public computer?
zheka24 [161]

Answer:

B. Someone can steal the information and hurt you.

Explanation:

People can hack into your accounts using your informations and spread hurtful things that can make people hurt. The people will think that you posted this (even if you didn't) and blame you.

7 0
2 years ago
What does the statement that follows do? double gallons[6] = { 12.75, 14.87 }; a. It assigns the two values in the initializatio
Serhud [2]

Answer:

It assigns the two values in the initialization list to the first two elements and default values to the other elements.

Explanation:

Given

The array initialization

Required

Interpret the statement

double gallons[6] implies that the length/size of the array gallons is 6.

In other words, the array will hold 6 elements

{12.75, 14.87} implies that only the first two elements of the array are initialized ; the remain 4 elements will be set to default 0.

3 0
4 years ago
Other questions:
  • The binary search algorithm ________. will have a maximum number of comparisons equal to the number of elements in the array wil
    7·1 answer
  • What can be done in order to secure a WLAN/wireless access point?
    12·1 answer
  • The sum of the elements of an integer-valued array recursively calculated as follows: The sum of an array of size 0 is 0; Otherw
    15·1 answer
  • Why is it important to try to make financial decisions without emotions.
    12·2 answers
  • What is the most important trait of the first pilot project in the AI Transformation Playbook?
    10·1 answer
  • Suppose you have four 500 MB hard drives plus one 2 GB flash drive. How many GB of capacity is this overall?
    12·1 answer
  • What factors contribute to food wastage
    12·1 answer
  • Can someone please answer these questions! Thank you :)
    5·1 answer
  • Why a commerce student must learn about SDLC (Software Development Life Cycle) and its phases?
    12·1 answer
  • Select the correct term to complete the sentence.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!