What are the different selection structures in the C programming language?

Answers

Answer 1

Answer:

SELECTION STRUCTURES

Selection statements allow you to control the flow of program execution on the basis of the outcome of an expression.

different selection structures are:

1)if statements

2)if-else statements

3)if-else-if statements

4)switch statements

Explanation:

THE IF STATEMENTS

the first statement in the if block is only executed when the specified condition is true.If the condition is false then the contained statement will be skipped and execution continued with the rest of the program.

example:

public class IfDemo

{

public static void main(String[] args) {

int age;

Scanner inputDevice = new Scanner(System.in);

System.out.print("Please enter Age: ");

age = inputDevice.nextInt();

if(age > 18)

System.out.println("above 18 ");

}

}

THE IF-ELSE STATEMENTS

if the specified condition in the if statement is false, then the statement after else will be executed.

example:

public class IfElseDemo

{

public static void main( String[] args )

{

int age;

Scanner inputDevice = new Scanner( System.in );

System.out.print( "Please enter Age: " );

age = inputDevice.nextInt();

if ( age >= 18 )

System.out.println( "above 18 " );

else

System.out.println( "below 18" );

}

}

THE IF-ELSE-IF STATEMENTS

the statements after else can be another if or if-else statement, multiple if-else statements.When the condition is true, the associated statement will be executed and remaining conditions will be bypassed.

example:

public class IfElseIfDemo

{

public static void main( String[] args )

{

int age;

Scanner inputDevice = new Scanner( System.in );

System.out.print( "Please enter Age: " );

age = inputDevice.nextInt();

if ( age >= 18 && age <=35 )

System.out.println( "between 18-35 " );

else if(age >35 && age <=60)

System.out.println("between 36-60");

else

System.out.println( "not matched" );

}

}

THE SWITCH STATEMENTS

It is a multi way branch statement. It defines multiple paths of execution of a program.It provides a better alternative than if-else-if statements.

example:

public class SwitchDemo

{

public static void main( String[] args )

{

int age;

Scanner inputDevice = new Scanner( System.in );

System.out.print( "Please enter Age: " );

age = inputDevice.nextInt();

switch ( age )

{

case 18:

System.out.println( "age 18" );

break;

case 19:

System.out.println( "age 19" );

break;

default:

System.out.println( "not matched" );

break;

}

}

}

Answer 2

The different types of selection structures in the C programming language are:

1) if statements2) if-else statements3) if-else-if statements4) switch statements

What is C programming language?

The sequence statement, selection statements (of which there are three variants: if, if...else, and switch), and repetition statements are the only three forms of control structures available in C++.

Due to the fact that C is compiled, it is a quicker language than Python. Since Python programs are interpreted, they typically run more slowly than C applications. When a variable is created in C, its type must be defined, and only values of that specific type are allowed to be given to it.

Therefore, the different selections of C programming languages are

1) if statements2) if-else statements3) if-else-if statements4) switch statements

To learn more about C programming language, refer to the link:

https://brainly.com/question/10937743

#SPJ2


Related Questions

Analyze the given word pattern and choose the correct option.
If WORD is coded as 9753, then what is the code for DOOR?

Answers

Answer:

The code for DOOR would be 3775.

Explanation:

WORD - 9753

W - 9

O - 7

R - 5

D - 3

DOOR: 3775

If WORD is coded as 9753, then what is the code for DOOR would be = 3775.

What is word coding?

Word pattern coding is defined as the systematic representation of words using another word, figures or numbers. That is;

W = 9

O = 7

R = 5

D = 3

This means that for the word DOOR, the code would be;

D = 3

O = 7

O= 7

R= 5

Code for WORD= 3775

Learn more about word pattern coding here:

https://brainly.com/question/31283683

#SPJ2

please help me with this. this my past homework and it's already stressing me out ehehe so it would make me happy if someone helped me :DD , please help me with atleast 5? thank you sm!​

Answers

Answer:

14. editor

8. managers

12. news

5. nameplate

10. dummy

.Write a Basic program to display first 10 natural numbers
(using IF… THEN ..ELSE (or) FOR..LOOP)​

Answers

Explanation:

CLS

x=1

For I = 1 to 10

Print x;

x = x+1

Next I

End

Answer:

Using for loop:

int i=0;

for(i=1;i<=10;i++)

{

printf(“%d”,i);

}

Using while loop:

int i=1;

while(i<=10)

{

printf(“%d”,i);

i++;

}

Using do while loop:

int i=1;

do

{

printf(“%d”,i);

i++;

}while(i<=10);

Sam, an administrator, sends out an HR policy file to Vicky, Mohammad, Charle, and Reena. They save the HR policy file on their home directories under a shared folder of Windows Server 2019 with different file names. As a result, the same copies of the file are present multiple times with different names. Reena opens and saves the file after making minor changes. What will happen to the files when Sam enables the Data Deduplication Service on Windows Server 2019

Answers

The thing that will occur to the files when Sam enables the Data Deduplication Service on Windows Server 2019 is that;

A new copy of Reena's file is formed and linked with the same file name.

What is Data Deduplication?

Data deduplication is known to be a kind of method that is used to remove too much copies of data and it is known to help to lower storage capacity requirements.

This act of Deduplication is known to be one that can be run as an inline process due to the fact that the data is being written into the storage system. When data is done in a background process, it acts to remove other copies after the data has been written to disk.

Learn more about  Data Deduplication from

https://brainly.com/question/24309209

A bitmap image is provided in two different resolutions. Image 1 has a resolution of 1500 x 1225. Image 2 has a resolution of 500 x
350. Which of the following statements is true when the sizes of both the files are increased by 25 percent?
a.
a
Select one:
Image 1 is less sharp and has a smaller file size than image 2.
O b. Image 2 is less sharp and has a larger file size than image 1.
O c. Image 1 is sharper and has a larger file size than image 2.
O d. Image 2 is sharper and has a larger file size than image 1.
Clear my choice

Answers

The true statement regarding the two (2) bitmap images is: C. Image 1 is sharper and has a larger file size than image 2.

What is a bitmap image?

A bitmap image or bitmap image file (BIF) is also referred to as a raster graphic and it is generally made up of bits or dots that are called pixels.

Additionally, it is dependent on the resolution (size) of an image file and as such it becomes blurry when enlarged.

In this scenario, image 1 would become sharper and larger in size than image 2 when the original bitmap image files are increased by 25 percent.

Read more on bitmap image here: brainly.com/question/25299426


1. What is the difference between a group and a topic?

Answers

What is the difference between group and a topic ?

GroupYou can publish a comment or question to the main community feed or to a group of which you are a member. Members with a common interest can form group within the wider community to form a small community around that topic and group posts will only appear in the feeds of other group members, not in the general community feed.TopicTopic work similarly to hashtags. Use the "+" symbol to the left of the Post/Ask button to add a topic (tag) to your post or question so that it can be classified along with other related posts and topics are a way to group posts and queries with similar content, but they don’t bring everyone with the same interest together in one place and this is where the groups come in!

what is human computer interaction​

Answers

Explanation:

Human computer interaction is research in the design and the use of computer technology, which focuses on the interfaces between people and computers.

Answer:

It is the way humans interact with computers; interfaces, special effects, icons, and buttons, it does not end there. HCI can also be looked at as a study to see what [person] will do with the computer.

Determine the value of a and b at the end of the following code segment:

int a = 5;
int b = 10;
a++;
b*=a;
a = b + b;

The value stored for a is _____ and the value stored for b is _____

Answers

Answer:

15 and b is 20

Explanation:

Answer:

a = 120 and b = 60

Explanation:

a++ means a = a+1

b*=a is the same as b= a*b

After plugging in the variables,

Here are the results in order:

a = 6;

b = 60;

a = 120;

We only keep the nearest declared value of the variable, so "a" would equal 120 and "b" would equal 60.  

Which of the following are advantages of automatic updates?

They protect against viruses.

They protect against hackers.

They provide free software for your computer.

They keep your computer running at peak performance.

Answers

Answer:

They keep your computer running at peak performance.

This is the correct answer.

Answer:

A, B, and D

Explanation:

did and got correct

Determine the value of a and b at the end of the following code segment:

int a = 5;
int b = 10;
a++;
b*=a;
a = b + b;

The value stored for a is _____ and the value stored for b is _____

Choices

120 and 60
60 and 30
5 and 10
30 and 60

Answers

Answer:

30 and 60

Explanation:

Complete the sentence. are filters between the internet and a computer network.

Answers

Answer:

Fire walls

Explanation:

Answer:

Firewalls

are filters between the internet and a computer network.

Explanation:

What’s a good way to manage a long checklist of items to make sure nothing is forgotten?
A Write the list down three times before working on it.
B Break down larger tasks into smaller, more manageable tasks.
C Divide the list up into categories, and assign each part to individual team members.
D Convert the checklist into a GDD.

Answers

Answer:

C. Divide the list up into categories, and assign each part to individual team members.

Explanation:

Correct me if I'm wrong

When installing a processor, what must be placed between the processor and the cooler?

Answers

Answer:

Apply thermal paste to your new CPU Your CPU should now be locked and loaded, but you can’t just put your cooler back on and call it a day.

PLEASE MARK ME AS BRAINLESS!!!!!!!

What is the best action to take when filling a police report regarding identity theft ?

Answers

Question

•What is the best action to take when filling a police report regarding identity theft ?

Answer:

•Obtain a copy of your FTC Identity Theft Report. This will help you set up a recovery plan.

•Provide a photo ID. You'll need to prove your identity by providing identification, such as a driver's license or passport.

•Provide your address.

•Provide proof of identity theft.

Explanation:

#Let's Study

#I Hope It's Help

#Keep On Learning

#Carry On Learning

Different between barcode reader an

Answers

Different between barcode reader an


Explanation: not enough info

1222222222222222222222222222222

Answers

Answer:

whats that bro

Explanation:

brainliest me bro

Jae is a network consultant hired by a small business client. He has been asked to recommend a firewall solution. Given the relatively small size of the infrastructure, he suggests a firewall that provides integrated intrusion detection system/intrusion prevention system (IDS/IPS) functionality because a single device offering multiple functions is cost- and space-effective. What is the solution

Answers

The  solution to the issue above is to use Virtual firewall.

What is intrusion detection prevention systems?

The Intrusion detection systems (IDS) and intrusion prevention systems (IPS) is known to be a kind of system that often look into the network of a person.

It is often set up to identify the different incidents and logging information about them, hindering incidents, and reporting any issues to security administrators.

See options below

a. Virtual firewall

b. Next-generation firewall (NGFW)

c. Appliance firewall

d. Commercial software firewall

Learn more about intrusion prevention system from

https://brainly.com/question/14284690

Python 4.5 code practice

Answers

Answer:

"Write a loop that inputs words until the user enters DONE. After each input, the program should number each entry and print in this format:"

"#1: you entered _____"

"When DONE is entered, the total number of words entered should be printed in this format:"

"A total of ___ words were entered"

count = 0

data = input('Please enter the next word: ')

while data != "DONE":

   count = count + 1

   print("#" + str(count) +": You entered the word " + data)

   data = input("Please enter the next word: ")

   

print("A total of "+ str(count) + " words were entered.")

Explanation:

we are counting starting from 0 when the user inputs a word the code then counts the word and stores is as data and continues until the user inputs DONE

list four ways to edit cell contents?

Answers

Answer:

text, formatting, formulas, and functions

Explanation:

A hexadecimal input can have how many values

Answers

Answer: Unlike the decimal system representing numbers using 10 symbols, hexadecimal uses 16 distinct symbols, most often the symbols "0"–"9" to represent values 0 to 9, and "A" to "F" (or alternatively "a"–"f") to represent values from 10 to 15.

Explanation:

what are all the fallacies and their meanings

Answers

Answer:

i dont know you tell me

Explanation:

write down same applacations of AI in agrilcaltural health education and bussness​

Answers

Answer:

Crop and soil monitoring.

Insect and plant disease detection.

Livestock health monitoring.

Intelligent spraying.

Automatic weeding.

Aerial survey and imaging.

Produce grading and sorting

Draw a flowchart or write a pseudocode to represent the logic of a program that allows the user to enter two values. The program outputs the sum of and the difference between the two values

Answers

Answer:

Start input myNumber

Start input myOtherNumber

set myAnswer = myNumber + myOtherNumber output myAnswer stop

Explanation:

Pseudocode is a computer programming language that resembles plain English and is compiled or processed into the computer. It explains the solution to the problem. Sometimes used as a detailed step by step process in developing a program

Briefly discuss what is the basic architecture of a computer system?

Answers

Answer:

From strictly a hardware aspect;

Explanation:

The basic architecture of a computer is the case (otherwise known as tower), the motherboard, and power supply unit. The case is used to house all of the necessary parts for the computer function properly. The motherboard will serve as the bridge between all other connections, and the power supply unit will deliver capable power to the rest of the system.

Find the output for the following program​

Answers

Answer:

It is a mathematical function program that displays many results to a math problem. R is the result of the problem, and when X and Y are done multiplying, they then print the result of this problem. That is why it says...

Print(f"The result is {R}")

Do not mind the letter f! That is just an abbreviation for an f string, a commonly used function in Python used to make string concatenation easier.

I hope this answers your question, apologies for late notice, and have a great day!

Answer:

(R)

Explanation:

cleann approved

What type of program would you use to create a personal budget?

Answers

Answer:

using Excel is the easiest way to create and use a budget, based on the formulas you can create to have the budget do the work for you, instead of vice versaExplanation:

What does the example of Friendster illustrate about social media platforms?

A.
People are loyal to social networking sites.

B.
Users will have little patience for technical issues.

C.
Professional networking sites are more popular than social networking.

D.
Most social media platforms don’t last more than a year.

Answers

Answer:

A

Explanation:

It's just what it's meant it doesn't need much explanation

People are loyal to social networking sites is example of Friendster illustrate about social media platforms.

What are social media platforms?

Websites and programs that emphasize collaboration, sharing of content, engagement, and community-based feedback are collectively referred to as social media.

Social media is used by people to connect and communicate with their friends, family, and other communities. Social media applications are used by businesses to track consumer complaints as well as market and promote their products.

Websites that cater to businesses selling to consumers have social features like comment sections for users. Businesses can track, evaluate, and analyze the attention their firm receives from social media, as well as brand perception and customer insight, using a variety of technologies.

Therefore, People are loyal to social networking sites is example of Friendster illustrate about social media platforms.

To learn more about Social media platforms, refer to the link:

https://brainly.com/question/29459870

#SPJ2

2. While relaxing at home, you access your school's online library to complete your homework. This is a good example of
A. teens being addicted to their phones and the Internet.
B. a lack of proper infrastructure.
C. the Internet making research and learning easy.
D. the Internet making everyday tasks easier.

Answers

most likely going to be c

Accessing the school's online library from home showcases how the Internet simplifies research and learning.

Hence, The correct option is C.

The objective of this question is to assess your understanding of the positive impact the Internet has on research and learning.

It aims to evaluate your ability to identify and analyze the benefits of accessing online libraries from home.

Accessing your school's online library from the comfort of your home is a great example of how the Internet has made research and learning more convenient and accessible.

Instead of having to physically go to the library, you can now easily access a vast amount of resources and complete your homework from the comfort of your own home.

It's a wonderful way to take advantage of the benefits that the Internet offers for education.

Hence,

Option C is correct.

To learn more about a library visit:

https://brainly.com/question/31622186

#SPJ3

Which of the following is an example of a project assumption? Current service levels to customers will be maintained throughout the project. All new technology components should be compatible with existing platforms. The project is designed to decrease costs by 45 percent in the first year after installation. The implementation plan must not disrupt the work of fellow employees.

Answers

Answer:

Current service levels to customers will be maintained throughout the project

Explanation:

The project assumption in the given options is: "Current service levels to customers will be maintained throughout the project."

A project assumption is a statement or belief about the project that is considered to be true, without any concrete evidence or proof at the time. It is an assumption made at the beginning of the project, based on available information and expectations.

In the given options, the assumption "Current service levels to customers will be maintained throughout the project" implies that the project team assumes that the quality and level of service provided to customers will remain consistent and unaffected during the project's execution.

Thus, this assumption suggests that the project team anticipates that any changes or activities related to the project will not have a negative impact on customer service.

For more details regarding project assumptions, visit:

https://brainly.com/question/31716624

#SPJ6

To prevent information from getting into the wrong hands, _____ measures are necessary. Select 2 options. extreme extreme spyware spyware threat threat physical security physical security digital security

Answers

Answer: physical security and digital security

Explanation:

Physical security and digital security are the two measures necessary to prevent information from getting into the wrong hands.Therefore, the correct options are C and D.

What is physical and digital security?

Physical security involves securing physical access to places where sensitive information is stored or processed, such as data centers, server rooms, or offices. This can include measures such as access control systems, surveillance cameras, and security guards.

Digital security involves securing digital access to sensitive information, such as passwords, encryption, firewalls, and antivirus software. These measures protect against unauthorized access, hacking, and other digital threats.

Extreme spyware and threat are not measures that would prevent information from getting into the wrong hands.Therefore, the correct options are C and D.

Learn more about physical and digital security, here:

https://brainly.com/question/22440462

#SPJ3

The question is incomplete, but most probably the complete question is,

To prevent information from getting into the wrong hands, _____ measures are necessary. Select 2 options. \

A. extreme spyware

B. threat

C. physical security

D. digital security

Other Questions
Evaporation and condensation are parts of which cycle?A.the energy cycleB.Earth's orbitC.the water cycleD.the life cycleplease answer asap :) Find the area of the figure. Use 3.14 for rI 10 in11 inA. 94.25 in2B. 188.5 in 2C. 133.5 in2D. 149.25 in2 For functions f(x)=5x2-1 and g(x)=4x-1, find (f.g)(1) The Teapot Dome Scandal sent several prominent members of the Harding administration to jail. The scandal involved the leasing of government land to what group QUESTION :- If ( + ) means ( - ) , ( - ) means ( ) , ( ) means ( + ) , ( ) means ( ) Then , 15 - 3 + 10 5 5 = ? a ) 42 b ) 48c ) 5 d ) 50i need a proper explanation how u got the ans , only ans if u know the ans ..Thx for answering I will mark brainliest / About Solving linear and quadratic equations i need help in these two questions because I didn't understand them well. what is the area of the image below rounded to the nearest whole number? Find the altitude of the right cylinder of maximum convex surface that can be inscribed in a given sphere. find the value of x in the triangle. 45-45-90. PLASE HELP!!! If 500 grams of grapes cost 2.80. Find the cost of 1.2 kg of grapes. Negative impacts of Hurricane Katrina on settlements 2. What does the king's reaction inSource B say about Swift's view ofEurope's military technology? In the given figure, O is the centre of a circle, TN is a Tangent, AN = 12 cm and OE = 5 cm. Find the length of NE. hello humans ~Which of the following scientists discovered cells in cork slices?A. Louis PasteurB. Antonie van LeeuwenhoekC. Carl LinnaeusD. Robert Hooke The angle of which muscle prevents the humeral head from sliding upward out of the joint as the arm is raised?. What is evaluate of 6a+2bIf a= -2, b=6 and c=5 a 120cm long piece of wood is cut into 5[tex]5 \frac{1}{4} [/tex] cm long pieces. How many such pieces will you get? ( (-3/4)5)2 simplified What is the exact area of the following circle? * Container A and container B are right circular cylinders. A has a radius of 4 inches and a height of 5 inches while container B has a radius of 2 inches and a height of 10 inches. Sarah pours equal amounts of oil into both containers and finds that the height of the oil in container A is 2 inches. What is the height of the oil in container B? Okay I know I have to find the volume of both which I did (container As volume is 80pi and container Bs volume is 40pi) but I dont know what to do after that. Can someone help me out?