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
Write and application that reads five integers from the user and determines and prints the largest and the smallest integers. Us
mixas84 [53]

Answer:

#include <stdio.h>  

#include <limits.h>  

 

/* Define the number of times you are going  

  to ask the user for input. This allows you  

  to customize the program later and avoids the  

  hard coding of values in your code */  

#define NUMVALS 5  

 

int main(void)  

{  

   int i = 0;  

   int curval = 0;  

   /* Set your initial max as low as possible */  

   int maxval = INT_MIN;  

   /* Set your initial min as high as possible */  

   int minval = INT_MAX;  

 

   /* Loop through and ask the user for the defined  

      number of values */  

   for (i = 0; i < NUMVALS; i++)  

   {  

       /* Ask the user for the next value */  

       printf("Enter the next value: ");  

 

       /* Get the next value from the user */  

       scanf("%d", &curval);  

 

       /* Check to see if this is our biggest or  

          smallest value yet */  

       if (curval > maxval)maxval = curval;  

       if (curval < minval)minval = curval;  

   }  

 

   /* Output the results */  

   printf("The smallest value entered was: %d \n", minval);  

   printf("The largest value entered was: %d \n", maxval);  

 

   /* End the program */  

   return 0;  

}

Explanation:

5 0
3 years ago
Currently James’s company is using RADIUS for AAA services to connect wireless users to the Windows Active Directory domain. How
icang [17]

Answer:

Terminal Access Controller Access Control System (TACACS+)

Explanation:

Terminal Access Controller Access Control System (TACACS+) can be used as an upgrade to RADIUS (Remote Authentication Dial-in User Service) for AAA (Authentication Authorization Accounting) services to connect wireless users to the Windows Active Directory domain.

TACACS+ is a Cisco-based wireless network that uses Transmission Control Protocol (TCP) and provides separate authentication, authorization and accounting services for users in bigger networks.

TACACS+ uses TCP port 49 while RADIUS uses UDP port 1812 and 1813.

3 0
4 years ago
Virtual classrooms are examples of communication or not​
3241004551 [841]

Answer:

I would say yes

Explanation:

8 0
3 years ago
Read 2 more answers
A proxy is
salantis [7]

Answer:

C. an authorization of a registered stockholder to another person to act in their place at the meeting

Explanation:

  • The proxy server acts as a gateway between you and the Internet.
  • it is a Intermediate Server separates users from browsing websites
  • Therefore, the proxy here refers to allowing someone to act on their behalf. In the case of the company, the proxy allows another person to act on behalf of the registered stockholder at company meetings.
4 0
3 years ago
______ is a slow process that takes place in nature. (2 points)
netineya [11]

Natural Selection.


♣Amaranthine
6 0
3 years ago
Other questions:
  • Fluyen en tecnologia
    15·1 answer
  • Which one of the following features can control left and right indents using markers?
    5·2 answers
  • How do you enlarge your screen if there is no control panel? Need desperate help!
    15·1 answer
  • 22 If you are involved in a violation and you do not have insurance to comply with the __________________, your driver license a
    9·2 answers
  • 5. Write a 500- to 1,000-word description of one of the following items or of a piece of equipment used in your field. In a note
    13·1 answer
  • Siva added a "Contact Form" to her website.
    10·1 answer
  • The ________ is the heart of the operating system and controls its most critical processes.
    9·1 answer
  • The options are file protection , fault-tolerance , fault line , file tolerance , and the question is which term describes the d
    6·1 answer
  • What is the last usable host IP address on the 192.168.32.9/30 network?
    15·1 answer
  • Where can you get information on receiving financial help?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!