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
Wittaler [7]
3 years ago
14

Nested if-else structures can contain many blocks of code. How many of those blocks of code might be executed?

Computers and Technology
1 answer:
dezoksy [38]3 years ago
7 0

Answer:            

A nested if else structure is defined as using one if-else inside another one. It is used when you want a take a decision by checking several conditions. Nested if can contain many block of codes with each block executing if the certain condition is met for each of that block.

The number of blocks of code, that might be executed depends on the condition that is intended to be met, in order to take a certain decision based on that condition. Let suppose if the desired condition is met in the very first block of code then only one block of code is executed. For example consider the following code:

if(number<5)

{  if(number==1)  {

  cout<<"number is 1"<<number; }

 else

 {       cout<<"number is greater than 1"<<number; } }

       else

      {         cout<<"number is greater than 5";}

Suppose the number entered is 1. So the first nested if condition is true and number is 1 will be displayed. So none of the else blocks has to be executed.

Number of code blocks that might be executed also relies on the number of block present in the code.

The execution also depends on the number of blocks that are true or false. If you want to execute a block for true condition, nested if else looks through every block until the block with the true desired condition is reached but if you want false condition to be checked to display the block of code when condition gets false then it will look through all the blocks until it gets the block with that false part.

For example consider the following code:

if ( number > 0)

   {        cout << "its a positive number: " << number;    }

   else if (number < 0)

   {         cout<<"its a negative integer: " << number;    }

   else     {

            cout << "its a 0";   }

Suppose the number is 0 and the program has to sequentially checks for each condition. It will check number>0 which is not what we need, then it will check else if statement for number<0 which is again not desired and finally it will display the block "its a 0" which matches the desired condition.

You might be interested in
Keith would like to compare data he has collected from research. The data includes the electrical output
liberstina [14]

Answer: my test says line graph soooo….

Explanation: if its what the test says

4 0
2 years ago
PLS HELP!! 50 Points! Will mark correct answer brainliest!!
Illusion [34]

Answer: C

Explanation:

That way she can have slides for her advance class and leave out slides that her normal class doesn’t need

5 0
3 years ago
Read 2 more answers
What is a computer network?
Contact [7]

Answer:

A computer network is a group of two or more computers that are linked together. Networks are usually used to share resources, exchange files or communicate with other users. so A

Explanation:

7 0
2 years ago
Double[][] vals =
Vilka [71]

Answer:

4

Explanation:

by counting the number of the colum to. be counted well and nicely

8 0
3 years ago
Which of the following is the estimate of the minimum amount of time it would take to perform a task? (Points : 2) Minimal durat
kondor19780726 [428]

Answer:

Optimistic duration

Explanation:

The following three concepts are Project management concepts:

Optismitic duration: Estimation of the shortest duration of a task, taking into account the difficulty, etc.

Pessimistic duration: Estamation of the longest duration of a task, taking into account the difficulty, etc

Expected duration: Expected duration of a task, kind of a compromise between the optmistic duration and the pessimistic duration.

Which of the following is the estimate of the minimum amount of time it would take to perform a task?

The answer is Optimistic duration

7 0
3 years ago
Other questions:
  • AMSCO networks plans to conduct a poll of viewers during the SuperBowl. They will conduct analysis to determine which area of th
    6·2 answers
  • Write a C program that reads a string containing text and nonnegative numbers from the user and prints out the numbers contained
    6·1 answer
  • What does obsolete mean?
    14·2 answers
  • Microsoft ________ is a cloud storage and file sharing service
    12·1 answer
  • It will gain you more knowledge, intensify your soft skills, strong work ethics and grow your network. What is it?​
    12·2 answers
  • What is the basic difference between a printer and a plotter?​
    12·1 answer
  • after clicking the start button on your computer screen desktop what option would you then select to examines system components
    8·1 answer
  • Write a filter that reads in a sequence of integers and prints the integers, removing repeated values that appear consecutively.
    5·2 answers
  • Using hard disk to temporarily store data or instructions from ram is referred to as the
    12·1 answer
  • 30 POINTS PLS HELLLLPPP WILL GIVE BRAINLIEST What behavior do elements in a stack follow? first in, last out, or FILO behavior l
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!