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
omeli [17]
3 years ago
7

Consider the following code.

Computers and Technology
2 answers:
serg [7]3 years ago
8 0
I think the answer is C
Maslowich3 years ago
3 0

Is this for a grade?

You might be interested in
Why are iterators useful?
Marina CMI [18]
It is d because I said it is
6 0
3 years ago
Develop a CPP program to test is an array conforms heap ordered binary tree. This program read data from cin (console) and gives
mafiozo [28]

Answer:

Following are the code to this question:

#include<iostream>//import header file

using namespace std;

int main()//defining main method

{

int ar[7];//defining 1_D array that stores value      

int i,x=0,l1=1,j; //defining integer variable

for(i=0;i<7;i++)//defining for loop for input value from user ends  

{

cout<<"Enter a Number: ";//print message

cin>>ar[i];//input value in array

if(l1<=2 && i>0)//using if block that checks the array values  

{

x++;//increment the value of x by 1  

}

if(l1>2 && i>0)//using if block that checks the array values  

{

l1=l1-2;//using l1 variable that decrases the l1 value by 2  

}

j=i-x;//using j variable that holds the index of the root of the subtree

if(i>0 && ar[j]>ar[i])// use if block that checks heap condition  

{

l1++; //increment the value of l1 variable

}

if(i>0 && ar[j]<ar[i])// using the if block that violate the heap rule  

{

cout<<ar[i]<<" "<<"Violate the heap";//print message with value

break;//using break keyword  

}

}

return 0;

}

Output:

1)

Enter a Number: -15

Enter a Number: -5

-5 Violate the heap

2)

Enter a Number: 45

Enter a Number: 0

Enter a Number: 55

55 Violate the heap

Explanation:

  • In the above-given C++ language code, an array "ar" and other integer variables " i,x,l1, j" is declared, in which "i" variable used in the loop for input values from the user end.
  • In this loop two, if block is defined, that checks the array values and in the first, if the block it will increment the value of x, and in the second if the block, it will decrease the l1 value by 2.
  • In the next step, j variable is used that is the index of the root of the subtree. In the next step, another if block is used, that checks heap condition, that increment the value of l1 variable. In the, if block it violate the heap rule and print its values.
5 0
3 years ago
A plain text e-mail and the same text entered into a word processing document would be about the same file sizes.
kumpel [21]
The email should be lighter but they're variables such as the word processing program. Not sure if this answered your question.
6 0
4 years ago
Read 2 more answers
Which function returns the rank of a value within a dataset, assigning an average rank for tied values
ANTONII [103]
Z-y bcuz it is a function and u need to revail rate
4 0
3 years ago
For the following graph, what is the goal state?
dolphi86 [110]

Answer:

E

Explanation:

3 0
3 years ago
Other questions:
  • 1. Create an interface called Runner. The interface has an abstract method called run() that display a message describing the me
    8·1 answer
  • The Internet is not a good place to connect with people when looking for a job.
    10·1 answer
  • What are the examples of debugging?​
    14·1 answer
  • What breakthrough in sound recording facilitated stereophonic recording? Ο Α. overdubbing O B. multitrack recording O C. digital
    10·1 answer
  • How does science impact the technology?
    8·2 answers
  • POR FAVOR AYUDENME DIGAN SOLO 10 Ejemplos de Software de Sistema. SI NO REPRUEBO Y LE DOY CORONA
    14·2 answers
  • Explain the working principal of computer system with suitable diagarm​
    9·1 answer
  • ____ includes) all tools that capture, store, process, exchange, and use information.
    9·1 answer
  • Verizon's implementation of a web-based digital dashboard to provide managers with real-time information such as customer compla
    6·1 answer
  • ____ takes care of the transport between machines. but it is unreliable, and there is no guarantee that any given packet will ar
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!