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

Explain inheritance and polymorphism in lingo programming, Question: (a...

Question: (a) Explain the concepts of Inheritance and Polymorphism in Lingo programming. (b) Write short descriptions on parent scripts and child objects in Lingo object

Fibonacci in windows assmbly language, Write an assembly program that compu...

Write an assembly program that computes Fibonacci numbers 2-5. a. Assume Fib(0)=0 and Fib(1)=1. b. Store Fib(2) in EAX, Fib(3) in EBX, Fib(4) in ECX and Fib(5) in EDX. c. Use a LOO

What is linear programming problem, QUESTION 1 (a) (i) What is linear p...

QUESTION 1 (a) (i) What is linear programming problem? (ii) Define and explain the following terms: (1) objective function, (2) decision variable, (3) constraints, (4) feasi

3-Tier Architecture in asp.net, I am getting error at business layer object...

I am getting error at business layer object in code behind page.

String data transfer instruction in assembly language, What are the string ...

What are the string data transfer instruction in assembly language? Explain all types of string data transfer instructions with examples of each? What will be the behavior of direc

Program which prints odd or even according to user input, Note: You should ...

Note: You should pay attention on following good practices: Appropriate code comments(If you make any assumptions clearly comment them in the code) Indentation

How do you find the complexity of an algorithm, How do you get the complexi...

How do you get the complexity of an algorithm? What is the relation b/w the time & space complexities of an algorithm? Justify your answer with an example.

Differences between user and kernel level threads, Question : (a) Many ...

Question : (a) Many systems provide support for both user threads and kernel threads, resulting in different multithreading models. What are the two differences between user

Depth estimation from a single view camera, i doing a project about depth e...

i doing a project about depth estimation, i have done some research, and i used the block matching algorithm to get the motion vectors from the image sequences, i now have the prob

A Simple Distributed Computing Platform , You are asked to develop a replic...

You are asked to develop a replicator (client) that distributes a large job over a number of computers (a server group) on a single switched LAN (our BU04 lab). In this assignment,

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