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
Match the job task to the occupation that would perform it. 1. Research the causes and treatments of diseases physical scientist
Trava [24]

Answer:

1.Physical scientist

2.Life scientist

3.Electrical engineer

4.aerospace engineer

Explanation:

5 0
3 years ago
What happens in Word 2016 when the Home ribbon tab is clicked on?
serg [7]

Answer:

The answar is D.

Explanation:

7 0
3 years ago
Name the six parts of the product development life cycle.
Nuetrik [128]

Answer:

Development, Introduction, Growth, Maturity and Decline.

Explanation:

5 0
3 years ago
Read 2 more answers
The batteries on electric vehicles are recharged using electricity from either a wall socket or dedicated charging unit.
yuradex [85]

Answer:

true

Explanation:

7 0
3 years ago
To save a document with a new name, click _______ in the navigation bar and enter a new filename.
cricket20 [7]
Click the save as button
3 0
3 years ago
Other questions:
  • What is the purpose of inserting SmartArt in a Microsoft Office program? (1 point)
    11·2 answers
  • NEED HELP FAST
    13·2 answers
  • A network technician is assisting the security team with some traffic captures. The security team wants to capture all traffic o
    9·1 answer
  • You are part of a team that is setting up a movie streaming service. The company is planning on initially making available 500 m
    8·1 answer
  • What is the fastest way to move data over long distances using the internet, for instance across countries or continents to your
    13·1 answer
  • 4.In order for a driver to graduate from a learner’s license to an operator’s license, how many hours of driving need to be docu
    15·1 answer
  • Which one my guys I need help
    7·1 answer
  • Candy Kane Cosmetics (CKC) produces Leslie Perfume, which requires chemicals and labor. Two production processes are available:
    14·1 answer
  • If you were practicing keyboarding and the exercise contained the letters j, k, l, m, n, and b, what section of the
    14·1 answer
  • A technician wants to replace a failing power supply on a high-end gaming computer. which form factor should the technician be l
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!