Explain If-else statement

If-else statement: It is a control structure employed to select between performing one of two alternative events.

    if(boolean-expression){
        // Statements performed whenever expression is true.
        ...
    }
    else{
        // Statements performed whenever expression is false.
        ...
    }

This is controlled by a Boolean expression.

   Related Questions in Programming Languages

  • Q : State the term GPC and GPT State the

    State the term GPC and GPT.

  • Q : Define Class inheritance Class

    Class inheritance: Whenever a super class is expanded through a sub class, a class inheritance relationship exists among them. The sub class inherits the attributes and methods of its super class. Class inheritance in Java, is single

  • Q : Phenomenon of page fault Explain the

    Explain the phenomenon of page fault?

  • Q : Define Container Abstractions Container

    Container Abstractions: Abstractions for containers (such as lists, stacks, sets, or queues) may represent just the state of a container—e.g., full or empty—and abstract away from the actual container content. The list operations also need

  • Q : Explain While loop While loop: It is

    While loop: It is one of Java's three control structures employed for looping. The other two are: do loop and for loop. The while loop comprises of a Boolean expression and a loop body. The condition is tested prior to the loop body is entered for the

  • Q : Assembly program that reads in five

     I need to write assembly program that reads in five numbers from the user. The user can then be prompted for one of the following pieces of information to be computed and returned: . the mean of the five numbers; . the largest number in the set; . the smallest number in the set; . t

  • Q : What is Boundary error Boundary error :

    Boundary error: The errors which arise from programming mistakes prepared at the edges of a problem- indexing off the edge of an array, commencing with no items of data, loop termination and so forth. Boundary errors are a very general type of logical

  • Q : Self-created What is the difference

    What is the difference among a self-created certificate, Symbian Signed and a Symbian developer certificate?

  • Q : What does XSLT processing models include

    What does extensible style sheet language transformations processing models involve?

  • Q : Write a program using simple loop

    Objective:  The purpose of this problem is to gain experience with the principles necessary to write a program using simple loop, decision processing, counters and accumulators Save the Barns, a bi-partisan po

©TutorsGlobe All rights reserved 2022-2023.