Define the if - else statement - computer programming, Programming Languages

Assignment Help:

Define the If - else statement - computer programming?

The If - else statement

The universal form of if - else statement is

                        if(expression)

                        {

                                    statements 1;

                        }

                        else

                        {

                                    statements 2;

                        }

If  the 'expression' returns a true, then it will execute statements 1 otherwise if it returns false, then it will execute statements 2. The statements are able to be simple or compound statements.

634_Define the If - else statement - computer programming.png

Flowchart of if - else statement

For instance

                        if(x>10)

                        {         

                                    x=x+1;

                        }

                        else

                        {

                                    x=x-1;

                        }

If the value of x is greater than 10, it will execute x=x+1. I the value of x is less than 10, then it will execute x=x-1.


Related Discussions:- Define the if - else statement - computer programming

Write a program to compute the standard deviation, Write three functions, s...

Write three functions, statistics, average, and sD as follows. The statistics function returns no value and has six parameters: four scores followed by their average and standard d

develop a page to indicate distinct attributes, 1.  Develop a page to indi...

1.  Develop a page to indicate distinct attributes of Font tag. 2.  Develop a page to indicate different attributes: bold, italics, underline. 3.  Design a page with backgrou

Database, How to create an ER diagram?

How to create an ER diagram?

Write a program to perform an arithmetic operation, Write a program (calcul...

Write a program (calculation.ccp) to allow the user to perform an arithmetic operation on the two complex numbers entered.  The user can key in one of the four operations: addition

Python (using os.walk), Using os.walk, write a script that will print the f...

Using os.walk, write a script that will print the filenames of zero length files. It should also print the count of zero length files.

Shell script, program for pyramid in shell script

program for pyramid in shell script

Matlab, want to do an image-mean. but image is and mean is so an error ...

want to do an image-mean. but image is and mean is so an error showing Error using ==> minus Number of array dimensions must match for binary array op. wat to do?

C# xna game project, I need to finish my game project within two weeks usin...

I need to finish my game project within two weeks using XNA. Would you guys can help me to finish it? Thank you

C++ programing, how to rewrite C++ program the DNAStrand class (DNA Project...

how to rewrite C++ program the DNAStrand class (DNA Project) to instead store the nucleotide sequence in a dynamically-allocated array?

Board coloring problem description, Board Coloring Problem Description ...

Board Coloring Problem Description In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd