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

Program for create a menu, The creation of the menu will involve writing pr...

The creation of the menu will involve writing procedural code, using decision logic, writing a loop, and using the case statement.  Although it is not required for grading, it is r

Determine that the processes are iterative or recursive, Each of the follow...

Each of the following two procedures defines a method for adding two positive integers in  terms of the procedures inc, which increments its argument by 1, and dec, which decrement

Information management system, Write a detailed description on how you woul...

Write a detailed description on how you would go about planning information system for an organisation

Jsp help, what is the code to copy code on 1 jsp page to others

what is the code to copy code on 1 jsp page to others

Shell script to display system time in words, Normal 0 false ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Program for nuclear reactor - embedded systems, Implement the "Nuclear Reac...

Implement the "Nuclear Reactor" example using the following:  An ISR triggered by a button press  A task to update the temperatures  A semaphore to communicate between the ISR and

E-R diagram, can you give me online education system E-R daigram..

can you give me online education system E-R daigram..

Linux assignment , Hi how can I upload my hw to you experts?

Hi how can I upload my hw to you experts?

Shell script to display words of a file in ascending order, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Shell script, find value of nCr using function

find value of nCr using function

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