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
crimeas [40]
4 years ago
7

Create a method remove Evens that removes all even elements from an ArrayList of

Computers and Technology
1 answer:
igor_vitrenko [27]4 years ago
3 0

Answer:

#include <iostream>

# include <conio.h>

using namespace std;

main()

{

int size;

cout<<"enter the size of array";

cin>>size;

int a[size],b[size];

for (int i=0;i<size;i++)

{

cout<<"enter the value in array a"<<i;

cin>>a[i];

}

for (int k=0;k<=size;k++)

{

{

 if (a[k]%2==0)

 {

  for (int l=k; l<=size;l++)

  {

   

  a[l]=a[l+1];

   

   

     }

     size=size-1;

 }

   

}

}

cout<<"\nArray list without even";

for(int j=0;j<size+1;j++)

{

cout<<"\n"<<a[j];

}

getch();

}

Explanation:

There is an array taken of variable size, the program has been written to delete the even elements from the array list. In this program "size " is the integer variable that is taken to mention the total elements of the array. Then enter the values on different index of array.

After that program find the even values and then delete these values. After the operation new array will be displayed on output.

You might be interested in
Which of the following is true regarding data analysis? a. Disciplines and professions do not provide guidance on data analysis.
alisha [4.7K]

Answer: Option (B) is correct

Explanation:

Data analysis is known as a process or technique of cleansing, inspecting, transforming and also modeling data with the aim or goal of discovering useful and vital information, briefing conclusions and thus finally supporting decision-making. It tends to have multiple approaches and facets, encompassing or enclosing diverse methods under several names, and thus is used in several different science, business, and dismal science domains.

3 0
3 years ago
Read 2 more answers
In the MOV instruction both operands i.e. source andthe destination cannot be
nekit [7.7K]

Answer:

an immediate.

Explanation:

It is because of the instruction encoding and decoding.Intel which make these instructions decided not include instructions which provide no real advantage. MOV segment register is one of them because segment register need not to be changed very often.This saves the space in instruction encoding.

3 0
4 years ago
Read 2 more answers
If an ARQ algorithm is running over a 40-km point-to-point fiber optic link then:
Dennis_Churaev [7]

Answer and Explanation:

Given data:

Distance (D) = 40 KM

Speed of light in the fiber =Distance/ speed of light in the fiber

a) Delay (P) = Distance/ speed of light in the fiber

= (40,000 Meters/2×108 m/s)

=( 40×103 Meters/2×108 m/s)

Propagation delay (P) = 0.0002 seconds or 200 microseconds

b)

if propagation delay is 0.0002 Seconds roundup trip time (RTT) will be 0.0004 Seconds or 400 micro Seconds

Essentially since transmission times and returning ACKs are insignificant all we really need is a value slightly greater than 0.0004 seconds for our timeout value.

c)

The obvious reasons would be if the data frame was lost, or if the ACK was lost. Other possibilities include extremely slow processing on the receive side (late ACK).

Or Extremely Slow Processing of the ACK after it is received back at the send side.

4 0
3 years ago
Which of the following code segments does not contain any errors?
Readme [11.4K]

Answer:

c. double triple(float n) { return (3 * n); }

Explanation:

In option a print is used to print integer.While printf is used in C to print something.

In option b there is no * operator between s s s it should be s*s*s.So it will give error.

In option d there is also no multiply operator * in between 3.14 2 r it should be 3.14*2*r.

So we can say that option c is error free.

8 0
3 years ago
Write the proghrams for the following:
belka [17]

Answer:

a)

#include <iostream>

using namespace std;

int main() {

   bool a,b,c;

   cin>>a>>b;

   if(a^b)//X-OR operator in C++.

   c=true;

   else

   c=false;

   cout<<c;

return 0;

}

b)

#include <iostream>

using namespace std;

int main() {

   bool a,b,c,d;

   cin>>a>>b>>c;

   if((a^b)^c)//X-OR operator in C++.

   d=true;

   else

   d=false;

   cout<<d;

return 0;

}

Explanation:

The above written programs are in C++.There is an operator (^) called X-OR operator in C++.It returns true if the number of 1's are odd and returns false if the number of 1's are even.

In the if statement I have user X-OR operator(^) to find the result and storing the result in another boolean variable in both the questions.

5 0
4 years ago
Other questions:
  • Write a program that reads in the length and the width of a rectangular yard.
    5·1 answer
  • What is binary number
    11·1 answer
  • The Internet shopping cart is an example of which version of the web?
    15·1 answer
  • Which of the following is NOT a web browser?<br> Safari<br> Chrome<br> Bing<br> Firefox
    8·2 answers
  • How do you record yourself on a macbook pro
    9·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • Design a hierarchy c hart or flowchart for a program that calculates the current balance in a savin gs account. The program must
    8·1 answer
  • This diagram shows a number of computing devices connected to the Internet with each line representing a direct connection.
    11·1 answer
  • Write a function so that the main program below can be replaced by the simpler code that calls function mph_and_minutes_to_miles
    7·1 answer
  • A trackerball is a pointing device
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!