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
3.5.6 Introduce Yourself, Part 2<br><br><br> please hellllpp it keeps saying the code is wrong
dalvyx [7]

Answer:

In Python:

name = "Arthur"

age = "62"

print("Hi! My name is "+name+" and I am "+age+" years old")

Explanation:

Given

See attachment

Required

Write a code to introduce yourself

Initialize name

name = "Arthur"

Initialize age

age = "62"

Print introduction

print("Hi! My name is "+name+" and I am "+age+" years old")

3 0
3 years ago
Question # 7 Dropdown Select the correct word to complete the sentence. The original ARPANET had four nodes and connected groups
attashe74 [19]

Answer:

Facility

Explanation:

This is the answer because you can spell it out with Horizon.

4 0
3 years ago
Read 2 more answers
What is the output of the following program fragment? int alpha [ 5 ] = {100, 200, 300, 400, 500}; int i; for (i = 4; i &gt; 0;
masha68 [24]
Out put:
500 400 300 200
3 0
3 years ago
A disadvantage of creating a website with tables, without CSS is
ikadub [295]
I am just gonna yolo it... <span>each table has to be updated individually </span>
6 0
3 years ago
Read 2 more answers
How does the use of Information communication technology prepare individuals for the work place
dem82 [27]

The use of information communication technology  in workplace helps improve the productivity of the people the workplace.

Explanation:

Information communication technology in general improves the quality of human life.

It involves sharing of data, it  also helps to manage information and knowledge, process and distribute and exchange information .

It can help help, by making the business easier to operate with a proper communication  between the vendor , client,and the distributor. It helps simplifying the work and increases the productivity in the workplace.

It helps the individuals to be still connected to their families, even if they are at their workplace or travelling .

6 0
3 years ago
Other questions:
  • When listing columns in the select list, what should you use to separate the columns?
    6·1 answer
  • Every computer consists of physical components and nonphysical components. the nonphysical components of a computer that underst
    9·1 answer
  • The destructor automatically executes when the class object goes out of ____.
    12·1 answer
  • Which statement best describes when Variable Substitution (expansion) can occur?
    6·2 answers
  • Select each task that may be completed using a word processor.
    8·2 answers
  • What happens if i unplug my alarm system?
    11·1 answer
  • Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their
    6·1 answer
  • Help help help help​
    6·1 answer
  • Who is responsible for the actions of autonomous systems? (please help me :C)
    14·2 answers
  • Write a method named removeDuplicates that accepts as a parameter a List of integers, and modifies it by removing any duplicates
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!