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
Alinara [238K]
3 years ago
10

Different between if/else structure and switchstructure in c and c++, why switch statements is more efficientthan using multiple

if/else statements?
Computers and Technology
1 answer:
ad-work [718]3 years ago
7 0

Answer:

Explanation:

Hello, great question. These types are questions are the beginning steps for learning more advanced Coding Problems.

If/Else statements receives an input and compares it to a true of false statement, if it is true then one function is called. Otherwise another function is called. IF/Else statements only have two outcomes which is why they are many times nested one on top of the other to be able to produce more outcomes.

Switch Statements receive and input and compares it to a set of predefined answers. If the right answer is found then the function relating to that answer is called. Otherwise the default function is called.

IF/Else is only more efficient than Switch statements if the inputted value is not predictable enough to make a predefined set.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

You might be interested in
Que es la felicidad??​
olchik [2.2K]
Se feliz el amor es nada
4 0
2 years ago
Consider the two computers A and B with the clock cycle times 100 ps and 150 ps respectively for some program. The number of cyc
Kipish [7]

Answer:

Option d) B is 1.33 times faster than A

Given:

Clock time, t_{A} = 100 ps

t_{A} = 150 ps

No. of cycles per instructions,  n_{A} = 2.0

n_{B} = 1.0

Solution:

Let I be the no. of instructions for the program.

CPU clock cycle, f_{A} = 2.0 I

CPU clock cycle, f_{B} = 1.0 I

Now,

CPU time for each can be calculated as:

CPU time, T = CPU clock cycle\times clock time

T_{A} = f_{A}\times t_{A} = 2.0 I\times 100 = 200 I ps

T_{B} = f_{B}\times t_{B} = 1.0 I\times 100 = 150 I ps

Thus B is faster than A

Now,

\frac{Performance of A}{Performance of B} = \frac{T_{A}}{T_{B}}

\frac{Performance of A}{Performance of B} = \frac{200}{150}

Performance of B is 1.33 times that of A

7 0
2 years ago
Read 2 more answers
25 points select 3 options!!!!!!!!!!!!!!!!!!!!!!!!!
Veronika [31]

Answer: don't know sorry

Explanation:

5 0
2 years ago
Read 2 more answers
We initialize the parameters to all zero values and run the linear perceptron algorithm through these points in a particular ord
Usimov [2.4K]

The main aim of running the parameters in the linear perceptron algorithm is to be able to develop a machine learning algorithm for binary classification tasks.

<h3>What is a linear perceptron algorithm?</h3>

This refers to the linear classification algorithm that is used in machine learning.

This is done in order to learn a decision boundary that divides different classes using a hyperplane.

Hence, we can see that your question is incomplete because the parameters are not included, hence a general overview was given to give you a better understanding of the concept.

Read more about machine learning here:

brainly.com/question/25523571

#SPJ1

7 0
2 years ago
Viết chương trình hoàn chỉnh các yêu cầu sau:
Blababa [14]

Explanation:

the perimeter of an aluminium sheet is 120 CM if its length is reduced by 10% and its breadth is increased by 20% the perimeter does not change find the measure of the length and the breadth of the sheet

4 0
3 years ago
Other questions:
  • The range A2:B4 has how many cells?<br><br> Answers:<br> 2,4,6,8
    10·2 answers
  • Mary is troubleshooting her company's LAN network. She finds out that data segments that the client is encoding are resulting in
    9·1 answer
  • Which of the following are the rows or columns of white space created between grids?
    7·1 answer
  • According to the ethical computer use policy, users should be __________ of the rules and, by agreeing to use the system on that
    11·1 answer
  • The most accurate readings that you can take on an analog VOM are when the meter's pointer is at the A. center scale. B. extreme
    11·1 answer
  • "What Search Network text ad component provides up to three fields of 30 characters each?"
    6·1 answer
  • Microsoft's ____ is one of the major web-based development environments.
    12·1 answer
  • Short note on first generation computer​
    10·1 answer
  • 1.What is the output of the following program? [10 Marks]namespace ConsoleApp1{class Program{static void Main(string[] args){int
    13·1 answer
  • Which artificial intelligence term is used to describe extracting information from unstructured text.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!