answersLogoWhite

0

What is branching in C?

Updated: 8/10/2023
User Avatar

Wiki User

12y ago

Best Answer

Branching in 'C' (or any other programming language) is where the flow of execution of code can change depending on some test condition. In 'C', this can be achieved with the "if" statement or the "switch" statement:

void branching (int i)

{

if ( i < 10) {

// Branch 1 - less than 10

printf("i is less than 10");

}

else {

// Branch 2 - 10 or more

printf("i is greater than or equal to 10");

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Normally a C program will execute in sequential order. So the program will start execute with main and end with return statement or getch. Using branching statements like if, switchi we can decide order of the execution by selecting some of the code to be executed.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Branching refers two have to seperat flow,just depending on the desetion block.It is the

easyer way to simplify the program by separating types of opration.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is branching in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What has the author C A Macken written?

C. A. Macken has written: 'Branching processes applied to cell surface aggregation phenomena' -- subject(s): Branching processes, Cell aggregation, Cell membranes, Mathematics


What are branching chains?

Generally branched chain hydrocarbons is where substituent groups (e.g. -methyl, CH3 or -hydroxy, OH) are attached onto the main chain of hydrocarbons. Branching is often used to shorten the chain length of hydrocarbons as shorter chain are more valuable. Branching is a type of reforming or isomerism of hydrocarbons. For example of the branched hydrocarbon of butane changes from: H H H H H CH3 H H - C - C - C - C - H to 2-methylpropane H - C - C - C - H H H H H H H H Very simply branching just changes the shape of a hydrocarbon


When was Branching Out created?

Branching Out was created in 1958-09.


Is the smooth muscle branching or non branching?

branched


How branching differes in roots versus sterms?

Branching in roots is endogenous and in stems it is exogenous


What is the branching pattern of a birch tree?

The branching pattern of the Lodgepole Pine is Alternate


Increase branching of a hydrcarbon has what effect on its octane rating?

Increasing branching increases octane rating.


How are dichotomous keys and branching diagrams different?

dichotomus key is a tool that is used by the scientist can use to help identify a particular specimen while branching key is just branching into two.


Do most conifers exhibit excurrent branching or deliquescent branching?

They exhibit excurrent branching because their terminal buds grow tall and straight with branches coming from a large central shaft.


What is branching diagrams used for?

A branching tree diagram shows prbable evolutionary relationships among organisms


What is a branching diagram used for?

A branching tree diagram shows prbable evolutionary relationships among organisms


How are dichotomous keys and branching key diagram different?

dichotomus key is a tool that is used by the scientist can use to help identify a particular specimen while branching key is just branching into two.